View source: R/persistence-diagram.R
| autoplot.persistence_diagram | R Documentation | 
persistence_diagram objectsThis function creates a visualization of a persistence diagram and returns the corresponding ggplot2::ggplot object which enable further customization of the plot.
## S3 method for class 'persistence_diagram'
autoplot(
  object,
  dimension = NULL,
  alpha = 0.6,
  max_intervals = 20000,
  legend = FALSE,
  greyblock = TRUE,
  n = 10L,
  type = c("barcode", "diagram", "density"),
  ...
)
object | 
 An object of class   | 
dimension | 
 An integer value specifying the homology dimension to
visualize. Defaults to   | 
alpha | 
 A numeric value between 0 and 1 specifying the transparency of
points and lines in the plot. Defaults to   | 
max_intervals | 
 An integer value specifying the maximal number of
intervals to display. Selected intervals are those with the longest
lifetime. Set it to   | 
legend | 
 A boolean value specifying whether to display the legend about
the homology dimension(s). Defaults to   | 
greyblock | 
 A boolean value specifying whether to display a grey lower
triangle in the diagram representation for nicer output. Defaults to
  | 
n | 
 An integer value specifying the number of bins for plotting the
diagram as a density. Defaults to   | 
type | 
 A string specifyfing the type of representation. Choices are
  | 
... | 
 Other parameters to be passed on to next methods.  | 
A ggplot2::ggplot object.
pd <- as_persistence_diagram(tibble::tibble(
  birth = 0,
  death = 1,
  dimension = 0
))
ggplot2::autoplot(pd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.