pyobsmod.Dataset.scatter_plot_joint#

Dataset.scatter_plot_joint(which_stats: Sequence[str] | dict[str, Any] | None = None, names: Sequence[str] | None = None, fmt: str | Sequence[str] = '.2f', nbins: int = 8, rfreqs: list[float] = [0, 0.2, 0.4], ax: Axes | None = None, idline_kws: dict[str, Any] | None = None, regline_kws: dict[str, Any] | None = None, textbox_kws: dict[str, Any] | None = None, **kwargs) tuple[Axes, Axes, Axes]#

Scatter plot sns observed data against modelled data.

Add an identity line and display selected statistics with seaborn’s jointplot.

Parameters:
  • which_stats (Sequence[str] | dict[str, Any] | None) – Sequence of the statistics parameters to compute or alternatively a dictionary with the statistics parameters as keys and the arguments that are passed to the method as values.

  • names (Sequence[str] | None) – Sequence of the names of the statistics parameters. If None, the names are taken from the keys of the which_stats dictionary.

  • fmt (str | Sequence[str]) – Format string for the statistics. Can be a single string that is used for all statistics or a sequence of strings that is used for each statistic individually

  • nbins (int) – Number of bins for the histograms.

  • rfreqs (list[float]) – List of relative frequencies for the ticks on the histograms.

  • ax (plt.Axes | None) – Matplotlib axis to draw the plot on.

  • idline_kws (dict[str, Any] | None) – Dictionary that is passed to matplotlib.pyplot.axline for the identity line.

  • regline_kws (dict[str, Any] | None) – Dictionary that is passed to matplotlib.pyplot.axline for the regression line.

  • textbox_kws (dict[str, Any] | None) – Dictionary that is passed to matplotlib.pyplot.AnchoredText.

  • **kwargs – Additional arguments that are passed to matplotlib.pyplot.scatter.

Returns:

(ax, ax_histx, ax_histy) – The Matplotlib axes.

Return type:

tuple[matplotlib.pyplot.Axes]

Examples

import matplotlib.pyplot as plt

from pyobsmod import load_dataset_example

ds = load_dataset_example()
axs = ds.scatter_plot_joint(['bias', 'rmse', 'nrmse', 'r2'])

# You can (but don't have to) access the individual axes
ax, ax_histx, ax_histy = axs

plt.show()
../../_images/pyobsmod.Dataset.scatter_plot_joint_0_0.png