Skip to content

Visualization

plot_multiple_timeseries(datasets, variable='ntl', indexers=None, start_date=None, end_date=None, titles=None, y_max=None, title=None, font_scale=1.0, moving_average=None)

Plots one or multiple aggregated time-series datasets as vertically stacked subplots.

All subplots will share the same y-axis boundaries for direct comparability.

Parameters:

Name Type Description Default
datasets List[Dataset]

A list of spatially aggregated xarray Datasets.

required
variable str

The variable name to plot (e.g. "ntl").

'ntl'
indexers Optional[dict]

Optional dictionary of dimension coordinates to select specific data (e.g. {"geonameid": "Region_A"} or {"x": 10.5, "y": 20.1}).

None
start_date Optional[str]

Optional start date string (e.g., '2022-01-01') to slice the data.

None
end_date Optional[str]

Optional end date string (e.g., '2022-12-31') to slice the data.

None
titles Optional[List[str]]

Optional list of titles corresponding to each subplot. If not provided, will attempt to use the .attrs['step'] from each dataset.

None
y_max Optional[float]

Optional maximum limit for the y-axis.

None
title Optional[str]

Optional string for the overall figure title.

None
font_scale float

The scaling factor for the plot's font sizes.

1.0
moving_average Optional[int]

Optional moving average window size (days).

None

Returns:

Type Description
Figure

The generated matplotlib Figure.