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: petab.visualize.plotting.Figure, data_provider: petab.visualize.plotting.DataProvider)[source]

Bases: petab.visualize.plotter.Plotter

Matplotlib wrapper

static _error_column_for_plot_type_data(plot_type_data: str) Optional[str][source]

Translate PEtab plotTypeData value to column name of internal data representation

Parameters

plot_type_data (PEtab plotTypeData value) –

Return type

Name of corresponding column

static _square_plot_equal_ranges(ax: matplotlib.pyplot.Axes, lim: Optional[Union[List, Tuple]] = None) matplotlib.pyplot.Axes[source]

Square plot with equal range for scatter plots.

Return type

Updated axis object.

generate_barplot(ax: matplotlib.pyplot.Axes, dataplot: petab.visualize.plotting.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: Optional[str] = None, format_: str = 'png') Optional[Dict[str, matplotlib.axes._subplots.AxesSubplot]][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: matplotlib.pyplot.Axes, dataplot: petab.visualize.plotting.DataPlot, plotTypeData: str) None[source]

Generate lineplot.

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.

generate_scatterplot(ax: matplotlib.pyplot.Axes, dataplot: petab.visualize.plotting.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(ax, subplot: petab.visualize.plotting.Subplot) None[source]

Generate subplot based on markup provided by subplot.

Parameters
  • ax – Axis object.

  • subplot – Subplot visualization settings.

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

Bases: abc.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: petab.visualize.plotting.Figure, data_provider: petab.visualize.plotting.DataProvider)[source]

Bases: petab.visualize.plotter.Plotter

Seaborn wrapper.