Skip to content

Hi-plot's custom Python classes and functions

The hi-plot module delivered with the jackHI software suite provides a way to visualize histograms based on input objects and a plot function.

Hi-plot's input classes

HistogramPlotSetup

Contains the setup parameters for the histogram plot.

Attributes:

Name Type Description
x_label str

X-axis label for the histogram plot.

label_kwargs dict | None

Keyword arguments for the label formatting. If None, default formatting is applied.

figure_kwargs dict | None

Keyword arguments for the figure generation. If None, no specific options are toggled.

plot_kwargs dict | None

Keyword arguments for the plot formatting. If None, default formatting is applied.

use_latex bool

Whether to (attempt to) use LaTeX rendering for plotting purposes.

text_labels (bool, optional)

Whether to use text labels for the automatic y-axis label generation. By default False, which results in symbolic labels.

Parameters:

Name Type Description Default
x_label str

X-axis label for the histogram plot.

required
label_kwargs dict | None

Keyword arguments for the label formatting. If None, default formatting is applied.

required
figure_kwargs dict | None

Keyword arguments for the figure generation. If None, no specific options are toggled.

required
plot_kwargs dict | None

Keyword arguments for the plot formatting. If None, default formatting is applied.

required
use_latex bool

Whether to (attempt to) use LaTeX rendering for plotting purposes. By default False.

False
text_labels bool

Whether to use text labels for the automatic y-axis label generation. By default False, which results in symbolic labels.

False

HistogramPlotSave

Contains the save parameters for the histogram plot.

Attributes:

Name Type Description
save_file bool

Whether the histogram plot needs to be saved.

save_path Path

Path to the directory that contains the file in which the histogram plot is saved, if 'save_file' is True.

save_kwargs dict | None

Keyword arguments used to define how to save the histogram plot. If None, default save parameters are used.

Parameters:

Name Type Description Default
file_name str | None

Name of the file in which the histogram plot is saved, if 'save_file' is True. By default None, resulting in an empty stored file_name ''.

None
save_directory str | None

Path to the directory that contains the file in which the histogram plot is saved, if 'save_file' is True. By default None, resulting in an empty stored save_directory ''.

None
save_kwargs dict | None

Keyword arguments used to define how to save the histogram plot. By default None, so that default save parameters are used.

None
save_file bool

Whether the histogram plot needs to be saved. By default False.

False
generate_save_dir bool

Whether the directory of the file to be saved (save_directory) needs to be automatically created. By default False, which raises a ValueError if a file is trying to be saved in a non-existent directory.

False

Hi-plot's plot function

plot_histogram

Generate a histogram plot based on the Hist/JackHist objects generated by jackHI.

Parameters:

Name Type Description Default
histogram_object Hist | JackHist

Hist or JackHist option that contains the histogram/optimized histogram data that need to be plotted.

required
setup_args HistogramPlotSetup

Object containing setup arguments/keyword arguments for the histogram plot.

required
save_args HistogramPlotSave

Object containing save arguments/keyword arguments for the histogram plot.

required
display_plot bool

Whether the histogram plot should be displayed. By default False.

False