jpt.plotting.engines.matplotlib_engine

Attributes

matplotlib_version

plotstyle

Classes

MatplotlibRendering

Abstract supertype of distribution rendering engines. Instantiating this class with the engine parameter will

Functions

save_plot(fig, directory, fname[, fmt])

Module Contents

jpt.plotting.engines.matplotlib_engine.matplotlib_version
jpt.plotting.engines.matplotlib_engine.plotstyle = 'seaborn-v0_8-deep'
jpt.plotting.engines.matplotlib_engine.save_plot(fig, directory, fname, fmt=None)
class jpt.plotting.engines.matplotlib_engine.MatplotlibRendering

Bases: jpt.plotting.engines.rendering.DistributionRendering

Abstract supertype of distribution rendering engines. Instantiating this class with the engine parameter will overriding this class’s __new__ method and automatically create an instance of the respective subclass.

plot_multinomial(dist: Any, title: str = None, fname: str = None, directory: str = '/tmp', pdf: bool = False, view: bool = False, horizontal: bool = False, max_values: bool = None, alphabet: bool = False, **kwargs)

Generates a horizontal (if set) otherwise vertical bar plot representing the variable’s distribution.

Parameters:
  • title – the name of the variable this distribution represents

  • fname – the name of the file to be stored

  • directory – the directory to store the generated plot files

  • pdf – whether to store files as PDF. If false, a png is generated by default

  • view – whether to display generated plots, default False (only stores files)

  • horizontal – whether to plot the bars horizontally, default is False, i.e. vertical bars

  • max_values – maximum number of values to plot

  • alphabet – whether the bars are sorted in alphabetical order of the variable names. If False, the bars are sorted by probability (descending); default is False

Returns:

None

plot_numeric(dist: Any, title: str | bool = None, fname: str = None, xlabel: str = 'value', directory: str = '/tmp', view: bool = False, pdf: bool = False, **kwargs)

Generates a plot of the piecewise linear function representing the variable’s cumulative distribution function

Parameters:
  • title – the name of the variable this distribution represents

  • fname – the name of the file to be stored

  • xlabel – the label of the x-axis

  • directory – the directory to store the generated plot files

  • pdf – whether to store files as PDF. If false, a png is generated by default

  • view – whether to display generated plots, default False (only stores files)

Returns:

None

plot_integer(dist: Any, title: str = None, fname: str = None, directory: str = '/tmp', pdf: bool = False, view: bool = False, horizontal: bool = False, max_values: int = None, alphabet: bool = False, **kwargs)

Generates a horizontal (if set) otherwise vertical bar plot representing the variable’s distribution.

Parameters:
  • title – the name of the variable this distribution represents

  • fname – the name of the file to be stored

  • directory – the directory to store the generated plot files

  • pdf – whether to store files as PDF. If false, a png is generated by default

  • view – whether to display generated plots, default False (only stores files)

  • horizontal – whether to plot the bars horizontally, default is False, i.e. vertical bars

  • max_values – maximum number of values to plot

  • alphabet – whether the bars are sorted in alphabetical order of the variable names. If False, the bars are sorted by probability (descending); default is False

Returns:

None

plot_multivariate(dist: Any, title: str = None, fname: str = None, directory: str = '/tmp', pdf: bool = False, view: bool = False, **kwargs)
plot_gaussian(dist: Any, title: str | bool = None, fname: str = None, xlabel: str = '$x$', ylabel: str = '$p(x|\\mu,\\sigma)$', dim: int = 3, directory: str = '/tmp', view: bool = False, pdf: bool = False, **kwargs)

Generates a plot of the piecewise linear function representing the variable’s cumulative distribution function

Parameters:
  • title – the name of the variable this distribution represents

  • fname – the name of the file to be stored

  • xlabel – the label of the x-axis

  • directory – the directory to store the generated plot files

  • pdf – whether to store files as PDF. If false, a png is generated by default

  • view – whether to display generated plots, default False (only stores files)

Returns:

None