pyobsmod.Dataset.scatter_plot_sns#

Dataset.scatter_plot_sns(which_stats: Sequence[str] | dict[str, Any] | None = None, names: Sequence[str] | None = None, fmt: str | Sequence[str] = '.2f', idline_kws: dict[str, Any] | None = None, textbox_kws: dict[str, Any] | None = None, **kwargs) JointGrid#

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.

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

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

  • **kwargs – Additional arguments that are passed to sns.jointplot.

Returns:

grid – Seaborn JointGrid.

Return type:

seaborn.JointGrid

Notes

Note that in contrast to Dataset.scatter_plot and Dataset.time_series_plot this method does NOT take a matplotlib.pyplot.Axes object as an argument, since the underlying function creates a figure and several axes objects itself.

In practice this means simply, that this plot can NOT be used in subplots (without major work-arounds).

Examples

import matplotlib.pyplot as plt

from pyobsmod import load_dataset_example

ds = load_dataset_example()
grid = ds.scatter_plot_sns(['bias', 'rmse', 'nrmse', 'r2'])

# You can (but don't have to) access the figure and axes
fig = grid.fig
ax = grid.ax_joint
plt.show()
../../_images/pyobsmod.Dataset.scatter_plot_sns_0_0.png