plot.landscape {TDAkit}R Documentation

Plot Persistence Landscape

Description

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

Usage

## 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


# 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)



[Package TDAkit version 0.1.2 Index]