Learn R Programming

TDA (version 1.0)

plot.diagram: Plots the Persistence Diagram

Description

This function plots the Persistence Diagram stored in an object of class diagram. Optionally, it can also represent the diagram as a persistence barcode.

Usage

## S3 method for class 'diagram':
plot(x, diagLim=NULL, dimension=NULL, col=NULL, rotated=FALSE, barcode=FALSE, 
            band=NULL, add = FALSE, ...)

Arguments

x
an object of class diagram (as returned by the functions gridDiag and ripsDiag) or an $n$ by 3 matrix, where $n$ is the number of features to
diagLim
numeric vector of length 2, specifying the limits of the plot. If NULL then it is automatically computed using the lifetimes of the features.
dimension
number specifying the dimension of the features to be plotted. If NULL all the features are plotted.
col
an optional vector of length $P$ that stores the colors of the topological features to be plotted, where $P$ is the number of topological features stored in x.
rotated
logical: if FALSE the plotted diagram has axes (birth, death), if TRUE the plotted diagram has axes ((birth+death)/2,(death-birth)/2). Default is FALSE.
barcode
logical: if TRUE the persistence barcode is plotted, in place of the diagram.
band
numeric: if band!=NULL, a pink band of size band is added around the diagonal. If also barcode is TRUE, then bars shorter than band are dotted. Default is NULL.
add
logical: if TRUE, the points of x are added to an existing plot.
...
additional graphical parameters.

References

Brittany T. Fasy, Fabrizio Lecci, Alessandro Rinaldo, Larry Wasserman, Sivaraman Balakrishnan, and Aarti Singh. (2013), "Statistical Inference For Persistent Homology", (arXiv:1303.7117). To appear, Annals of Statistics.

Frederic Chazal, Brittany T. Fasy, Fabrizio Lecci, Alessandro Rinaldo, and Larry Wasserman, (2014), "Stochastic Convergence of Persistence Landscapes and Silhouettes", Proceedings of the 30th Symposium of Computational Geometry (SoCG). (arXiv:1312.0308)

See Also

gridDiag, ripsDiag

Examples

Run this code
XX1 = circleUnif(30)
XX2 = circleUnif(30, r=2) +3
XX=rbind(XX1,XX2)

DiagLim=5
maxdimension=1

## rips diagram
Diag=ripsDiag(XX,maxdimension,DiagLim, printStatus=TRUE)

#plot
par(mfrow=c(1,3))
plot(Diag)
plot(Diag, rotated=TRUE)
plot(Diag, barcode=TRUE)

Run the code above in your browser using DataLab