petab.visualize.plotter

PEtab visualization plotter classes

Classes

MPLPlotter(figure, data_provider)

Matplotlib wrapper

Plotter(figure, data_provider)

Plotter abstract base class.

SeabornPlotter(figure, data_provider)

Seaborn wrapper.

class petab.visualize.plotter.MPLPlotter(figure: Figure, data_provider: DataProvider)[source]

Bases: Plotter

Matplotlib wrapper

generate_barplot(ax: Axes, dataplot: DataPlot, plotTypeData: str) None[source]

Generate barplot.

Parameters:
  • ax – Axis object.

  • dataplot – Visualization settings for the plot.

  • plotTypeData – Specifies how replicates should be handled.

generate_figure(subplot_dir: str | None = None, format_: str = 'png') Dict[str, Axes] | None[source]

Generate the full figure based on the markup in the figure attribute.

Parameters:
  • subplot_dir – A path to the folder where single subplots should be saved. PlotIDs will be taken as file names.

  • format – File format for the generated figure. (See matplotlib.pyplot.savefig() for supported options).

Returns:

  • ax – Axis object of the created plot.

  • None – In case subplots are saved to file.

generate_lineplot(ax: Axes, dataplot: DataPlot, plotTypeData: str, splitaxes_params: dict) Tuple[Axes, Axes][source]

Generate line plot.

It is possible to plot only data or only simulation or both.

Parameters:
  • ax – Axis object.

  • dataplot – Visualization settings for the plot.

  • plotTypeData – Specifies how replicates should be handled.

  • splitaxes_params

generate_scatterplot(ax: Axes, dataplot: DataPlot, plotTypeData: str) None[source]

Generate scatterplot.

Parameters:
  • ax – Axis object.

  • dataplot – Visualization settings for the plot.

  • plotTypeData – Specifies how replicates should be handled.

generate_subplot(fig: Figure, ax: Axes, subplot: Subplot) None[source]

Generate subplot based on markup provided by subplot.

Parameters:
  • fig – Figure object.

  • ax – Axis object.

  • subplot – Subplot visualization settings.

class petab.visualize.plotter.Plotter(figure: Figure, data_provider: DataProvider)[source]

Bases: ABC

Plotter abstract base class.

figure

Figure instance that serves as a markup for the figure that should be generated

data_provider

Data provider

class petab.visualize.plotter.SeabornPlotter(figure: Figure, data_provider: DataProvider)[source]

Bases: Plotter

Seaborn wrapper.