monet.plots.timeseries

monet.plots.timeseries(df, x='time', y='obs', ax=None, plotargs={}, fillargs={'alpha': 0.2}, title='', ylabel=None, label=None)

Create a timeseries plot with shaded error bounds.

Parameters:
  • df (pandas.DataFrame) – DataFrame containing the data to plot.

  • x (str, default “time”) – Column name to use for the x-axis (time).

  • y (str, default “obs”) – Column name to use for the y-axis (values to plot).

  • ax (matplotlib.axes.Axes, optional) – Axes to plot on. If None, creates a new figure and axes.

  • plotargs (dict, default {}) – Additional arguments to pass to DataFrame.plot().

  • fillargs (dict, default {“alpha”: 0.2}) – Additional arguments to pass to fill_between for the error shading.

  • title (str, default “”) – Title for the plot.

  • ylabel (str, optional) – Y-axis label. If None, uses variable name and units from DataFrame.

  • label (str, optional) – Label for the plotted line (for legend). If None, uses y.

Returns:

The axes containing the plot.

Return type:

matplotlib.axes.Axes

Notes

This function groups the data by time, plots the mean values, and adds shading for ±1 standard deviation around the mean.