Learn R Programming

TDAkit (version 0.1.3)

plot.landscape: Plot Persistence Landscape

Description

Given a persistence landscape object in S3 class landscape, visualize the landscapes using ggplot2.

Usage

# S3 method for landscape
plot(x, ...)

Value

a ggplot2 object.

Arguments

x

a landscape object.

...

extra parameters including

top.k

the number of landscapes to be plotted (default: 5).

colored

a logical; TRUE to assign different colors for landscapes, or FALSE to use grey color for all landscapes.

Examples

Run this code
# \donttest{
# Use 'iris' data
XX = as.matrix(iris[,1:4])

# Compute Persistence diagram and landscape of order 0 
homology  = diagRips(XX)
landscape = diag2landscape(homology, dimension=0)

# Plot with 'barcode'
opar <- par(no.readonly=TRUE)
plot(landscape)
par(opar)
# }

Run the code above in your browser using DataLab