plot.landscape: Plot Persistence Landscape

Description Usage Arguments Value Examples

View source: R/utility_plot_landscape.R

Description

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

Usage

1
2
## S3 method for class 'landscape'
plot(x, ...)

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.

Value

a ggplot2 object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

kyoustat/TDAkit documentation built on Sept. 1, 2021, 7:22 a.m.