Skip to contents

The plot.persistence_diagram() function only displays the plot while the autoplot.persistence_diagram() in addition outputs the ggplot2::ggplot object. If one wishes to control graphical properties, it is recommended to use the latter to retrieve the ggplot2::ggplot object and modify and/or add layers as desired.

Usage

# S3 method for persistence_diagram
plot(
  x,
  dimension = NULL,
  alpha = 0.6,
  max_intervals = 20000,
  legend = FALSE,
  greyblock = TRUE,
  type = c("barcode", "diagram"),
  ...
)

# S3 method for persistence_diagram
autoplot(
  x,
  dimension = NULL,
  alpha = 0.6,
  max_intervals = 20000,
  legend = FALSE,
  greyblock = TRUE,
  n = 10L,
  type = c("barcode", "diagram", "density"),
  ...
)

Arguments

x

An object of class persistence_diagram.

dimension

An integer value specifying the homology dimension to visualize. Defaults to NULL in which case the dimension is retrieved directly in the persistence_diagram object.

alpha

A numeric value between 0 and 1 specifying the transparency of points and lines in the plot. Defaults to 0.6.

max_intervals

An integer value specifying the maximal number of intervals to display. Selected intervals are those with the longest lifetime. Set it to 0 to see them all. Defaults 20000L.

legend

A boolean value specifying whether to display the legend about the homology dimension(s). Defaults to FALSE.

greyblock

A boolean value specifying whether to display a grey lower triangle in the diagram representation for nicer output. Defaults to TRUE.

type

A string specifyfing the type of representation. Choices are "barcode", "diagram" or "density". Defaults to "barcode".

...

Other parameters to be passed on to next methods.

n

An integer value specifying the number of bins for plotting the diagram as a density. Defaults to 10L.

Value

For plot.persistence_diagram(), NULL. Otherwise a ggplot2::ggplot object.