pyobsmod.Dataset.stats_plot#

Dataset.stats_plot(which_stats: Sequence[str] | dict[str, Any], names: Sequence[str] | None = None, decimals: int = 2, fontsize: float = 10, xscale: float = 0.2, yscale: float = 1, ax: Axes | None = None, **kwargs) Axes#

Textbox plot summarizing specified statistics.

Parameters:
  • which_stats (Sequence[str] | dict[str, Any]) – 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.

  • decimals (int) – Number of decimal places to display for statistics. Defaults to 2.

  • fontsize (float | None) – Font size for the text in the textbox plot. Defaults to 10.

  • xscale (float | None) – Scales the width of the textbox plot. Defaults to 0.5.

  • yscale (float | None) – Scales the height of the textbox plot. Defaults to 1.

  • ax (matplotlib.pyplot.Axes | None) – Matplotlib axis to draw the plot on. If None, a new axis is created.

  • **kwargs – Additional arguments passed to matplotlib.pyplot.table for table customization.

Returns:

ax – The Matplotlib axis object containing the textbox plot.

Return type:

matplotlib.pyplot.Axes

Examples

import matplotlib.pyplot as plt

from pyobsmod import load_dataset_example

ds = load_dataset_example()
ds.stats_plot(['bias', 'rmse', 'nrmse', 'r2'])
plt.show()
../../_images/pyobsmod.Dataset.stats_plot_0_0.png