plot.homology: Plot Persistent Homology via Barcode or Diagram

View source: R/utility_plot_homology.R

plot.homologyR Documentation

Plot Persistent Homology via Barcode or Diagram

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

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


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



TDAkit documentation built on Nov. 5, 2025, 5:45 p.m.

Related to plot.homology in TDAkit...