qp.plotting: Tools for plotting

Functions to plot PDFs

qp.plotting.init_matplotlib() None[source]

Initialize matplotlib parameters

qp.plotting.make_figure_axes(xlim: tuple[float, float], **kwargs: Any)[source]

Build a figure and a set of figure axes to plot data on

Parameters:
xlimtuple[float, float]

The x-axis limits of the plot

**kwargs

Passed directly to the matplotlib plot function

Returns:
tuple [ Figure, Axes ]

The figure and axes

qp.plotting.get_axes_and_xlims(**kwargs: Any)[source]

Get and return the axes and xlims from the kwargs

Returns:
axesAxes

The axes for the figure

xlimtuple[float, float]

The limits for the x axis

kwargs

Additional kwargs to be passed on.

qp.plotting.plot_pdf_on_axes(axes, pdf: Ensemble, xvals: ArrayLike, **kwargs: Any)[source]

Plot a PDF on a set of axes, by evaluating it a set of points

Parameters:
axesAxes

The axes we want to plot the data on

pdfEnsemble

The distribution we want to plot

xvalsArrayLike

The locations we evaluate the PDF at for plotting

**kwargs

Keywords are passed to matplotlib

Returns:
Axes

The axes the data are plotted on

qp.plotting.plot_dist_pdf(pdf: Ensemble, **kwargs: Any)[source]

Plot a PDF on a set of axes, using the axes limits

Parameters:
pdfEnsemble

The distribution we want to plot

Returns:
Axes

The axes the data are plotted on

Other Parameters:
axesAxes

The axes to plot on

xlimtuple [float, float]

The x-axis limits

nptsint

The number of x-axis points

**kwargs

Passed directly to the plot_pdf_on_axes plot function

qp.plotting.plot_pdf_quantiles_on_axes(axes, xvals: ArrayLike, yvals: ArrayLike, quantiles: tuple[ndarray, ndarray], **kwargs: Any)[source]

Plot a PDF on a set of axes, by evaluating at the quantiles provided

Parameters:
axesAxes

The axes we want to plot the data on

xvalsArrayLike

Pdf xvalues

yvalsArrayLike

Pdf yvalues

quantilestuple [ np.ndarray, np.ndarray ]

The quantiles that define the distribution pdf

**kwargs

Passed directly to the matplotlib plot function

Returns:
Axes

The axes the data are plotted on

Other Parameters:
npointsint

Number of points to use in the plotting. Evenly spaced along the axis provided.

qp.plotting.plot_pdf_histogram_on_axes(axes, hist: ArrayLike, **kwargs: Any)[source]

Plot a PDF on a set of axes, by plotting the histogrammed data

Parameters:
axesAxes

The axes we want to plot the data on

histArrayLike

Histogram data

**kwargs

Passed directly to the matplotlib plot function

Returns:
Axes

The axes the data are plotted on

Other Parameters:
npointsint

Number of points to use in the plotting. Evenly spaced along the axis provided.

qp.plotting.plot_pdf_samples_on_axes(axes, pdf: Ensemble, samples: ArrayLike, **kwargs: Any)[source]

Plot a PDF on a set of axes, by displaying a set of samples from the PDF

Parameters:
axesAxes

The axes we want to plot the data on

pdfEnsemble

The distribution we want to plot

samplesArrayLike

Points sampled from the PDF

**kwargs

Passed directly to the matplotlib plot function

Returns:
Axes

The axes the data are plotted on

qp.plotting.plot_native(pdf, **kwargs)[source]

Utility function to plot a pdf in a format that is specific to that type of pdf

qp.plotting.plot(pdf, **kwargs)[source]

Utility function to plot a pdf in a format that is specific to that type of pdf