Skip to contents

This function creates a visualization of a persistence diagram without returning the corresponding ggplot2::ggplot object.

Usage

# S3 method for persistence_diagram
plot(
  x,
  dimension = NULL,
  alpha = 0.6,
  max_intervals = 20000,
  legend = FALSE,
  greyblock = TRUE,
  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.

Examples

pd <- as_persistence_diagram(tibble::tibble(
  birth = 0,
  death = 1,
  dimension = 0
))
plot(pd)