rail.plotting.plot_holder module

class rail.plotting.plot_holder.RailPlotDict(name, plots)[source]

Bases: object

Simple class for dicts of matplotlib Figures

This collects a set of plots made on the same dataset. The key is typically the name of the RailPlotter used to make each plot.

Parameters:
property name: str

Return the name of the plot dict

property plots: dict[str, RailPlotHolder] | None

Return the dict of plots

savefigs(outpath, figtype='png', **kwargs)[source]
Return type:

None

Parameters:
  • outpath (str)

  • figtype (str)

  • kwargs (Any)

class rail.plotting.plot_holder.RailPlotHolder(name, path=None, figure=None, plotter=None, dataset_holder=None)[source]

Bases: object

Simple class for wrapping matplotlib Figure

This includes the path to where the figure is saved

Parameters:
property dataset_holder: RailDatasetHolder | None

Return the dataset used to make the plot

property figure: Figure | None

Return the matplotlib Figure

property name: str

Return the name of the plot

property path: str | None

Return the path to the saved plot

property plotter: RailPlotter | None

Return the object used to make the plot

savefig(relpath, outdir='.', **kwargs)[source]
Return type:

None

Parameters:
  • relpath (str)

  • outdir (str)

  • kwargs (Any)

set_figure(figure=None)[source]

Set the Matplotlib figure

Return type:

None

Parameters:

figure (Figure | None)

set_path(path=None)[source]

Set the path to the saved plot

Return type:

None

Parameters:

path (str | None)