plot.homology: Plot Persistent Homology via Barcode or Diagram

Description Usage Arguments Value Examples

View source: R/utility_plot_homology.R

Description

Given a persistent homology of the data represented by a reconstructed complex in S3 class homology object, visualize it as either a barcode or a persistence diagram using ggplot2.

Usage

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

Arguments

x

a homology object.

...

extra parameters including

method

type of visualization; either "barcode" or "diagram".

Value

a ggplot2 object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Use 'iris' data
XX = as.matrix(iris[,1:4])

# Compute VR Diagram 
homology = diagRips(XX)

# Plot with 'barcode'
opar <- par(no.readonly=TRUE)
plot(homology, method="barcode")
par(opar)

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