NAME#
plot_PD - Plot a persistence diagram as a color histogram or contour plot
SYNOPSIS#
homcloud-plot-PD
[-h] [-V] -d DEGREE [-T TYPE] [-N] [-p POWER] [-l]
[--loglog] [--linear-midpoint LINEAR_MIDPOINT] [-m MAX]
[--vmin VMIN] [-c COLORMAP] [-s STYLE] [-t TITLE]
[-U UNIT_NAME] [--font-size FONT_SIZE] [--aspect ASPECT]
[--plot-essential] [-D SCATTERING_SIZE] [-o OUTPUT]
[-x X_RANGE] [-X XBINS] [-y Y_RANGE] [-Y YBINS]
[-n NORMALIZE_CONSTANT] [-M MARKER] [--dpi DPI]
[--tight-layout]
INPUT [INPUT ...]
This program can also be invoked as python3 -m homcloud.cli.plot_PD.
ALIAS#
homcloud-plot-PD
DESCRIPTION#
This program plots a persistence diagram given by INPUT as a 2D histogram (color histogram by default, or a contour plot).
You can control the histogram binning with the -x/-X (birth
axis) and -y/-Y (death axis) options. If they are not given, the
range and number of bins are chosen automatically.
You can use multiple input files. In that case, all pairs from all files are merged into one diagram before plotting.
OPTIONS#
-h, --help show this help message and exit
-V, --version show program's version number and exit
-d DEGREE, --degree DEGREE
degree of PH
-T TYPE, --type TYPE input file format (pdgm, text) (default:
autodetect)
-N, --negate flip the sign of birth/death times for superlevel
persistence (default: False)
-p POWER, --power POWER
Output x^POWER for each value x
-l, --log Output log(x+1) for each value x
--loglog Output log(log(x+1)+1)
--linear-midpoint LINEAR_MIDPOINT
linear with midpoint
-m MAX, --vmax MAX Maximum of colorbar (default: autoscale)
--vmin VMIN Minimum of colorbar
-c COLORMAP, --colormap COLORMAP
matplotlib colormap name
-s STYLE, --style STYLE
plotting style (colorhistogram(default), contour)
-t TITLE, --title TITLE
title string
-U UNIT_NAME, --unit-name UNIT_NAME
The unit name of birth and death times
--font-size FONT_SIZE
font size (default: 12)
--aspect ASPECT histogram aspect (default: auto)
--plot-essential whether to plot essential values (default: False)
-D SCATTERING_SIZE, --diffuse-pairs SCATTERING_SIZE
Diffuse pairs using gaussian distribution of SD=SIGMA
-o OUTPUT, --output OUTPUT
output file
-x X_RANGE, --x-range X_RANGE
birth range
-X XBINS, --xbins XBINS
number of bins in birth-axis
-y Y_RANGE, --y-range Y_RANGE
death range
-Y YBINS, --ybins YBINS
number of bins in death-axis
-n NORMALIZE_CONSTANT, --normalize-constant NORMALIZE_CONSTANT
normalize constant to histogram height
-M MARKER, --marker MARKER
marker file
--dpi DPI output DPI (used with -o option, default is
savefig.dpi for matplotlib)
--tight-layout use tight layout (adjusting layout)
INPUT FORMAT#
A .pdgm file, or a text file of birth-death pairs (one pair per
line, -d is ignored in that case):
birth1 death1
birth2 death2
:
-T selects the format explicitly; by default it is auto-detected
from the file content/extension.
OUTPUT FORMAT#
If the output argument is not given, the plotted picture is shown in your display. If the output argument is given, the output format is determined by its extension. You can output the picture in PNG (.png), PDF (.pdf), and EPS (.eps). Other formats are also available if matplotlib supports them.