metobs_toolkit.station.Station.make_plot#
- Station.make_plot(obstype: str = 'temp', colorby: Literal['station', 'label'] = 'label', show_modeldata: bool = False, modelobstype: str = None, modeldata_kwargs: dict = {}, linecolor: str | None = None, show_outliers=True, show_gaps=True, title: str | None = None, ax: Axes | None = None, figkwargs: dict = {}) Axes[source]#
Generate a time series plot for observational data.
- Parameters:
obstype (str, optional) – The type of observation to plot. Default is “temp”.
modelobstype (str, optional) – The name of the ModelObstype to plot. It is only used if show_modeldata is True. If None, it is set equal to obstype. The default is None.
colorby ({"station", "label"}, optional) –
Determines how the data is colored in the plot.
”station”: Colors by station.
”label”: Colors by label (the labels refer to the status of a record).
Default is “label”.
show_modeldata (bool, optional) – If True, includes model data (of the same obstype) if present, in the plot. Default is False.
modeldata_kwargs (dict, optional) – Additional keyword arguments passed to make_plot_of_modeldata(), by default an empty dictionary. Use it for example to specify modelname if multiple model data is available.
linecolor (str or None, optional) – The color of the line for the model data. If None, a default categorical color map is used. Default is None.
show_outliers (bool, optional) – If True, includes outliers in the plot. Default is True.
show_gaps (bool, optional) – If True, gaps are represented by vertical lines in the plot if the gap is unfilled. If the gap is filled, it is plotted as a line. Default is True.
title (str or None, optional) – The title of the plot. If None, a default title is generated. Default is None.
ax (matplotlib.axes.Axes or None, optional) – The axes on which to draw the plot. If None, a new axes is created. Default is None.
figkwargs (dict, optional) – Additional keyword arguments passed to matplotlib.pyplot.subplots(), by default an empty dictionary.
- Returns:
The axes containing the plot.
- Return type:
matplotlib.axes.Axes
Notes
The method checks if the specified obstype is known before proceeding.
The plot can include observational data, model data, or both.
The x-axis timestamps are formatted according to the timezone of the data.