metobs_toolkit.analysis.Analysis.plot_diurnal_cycle#

Analysis.plot_diurnal_cycle(obstype: str = 'temp', colorby: str = 'name', title: str | None = None, ax: Axes | None = None, colordict: dict | None = None, legend: bool = True, return_data: bool = False, figkwargs: dict = {}) Axes | Tuple[Axes, DataFrame][source]#

Plot the diurnal cycle of a specified observation type, grouped by a given category.

Parameters:
  • obstype (str, optional) – The target observation type to plot (e.g., “temp”). Default is “temp”.

  • colorby (str, optional) – The category by which to group and color the data (e.g., “name”). Default is “name”.

  • 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 plot. If None, a new figure and axes are created. Default is None.

  • colordict (dict or None, optional) – A dictionary mapping group names to colors. If None, default colors are used. Default is None.

  • legend (bool, optional) – Whether to include a legend in the plot. Default is True.

  • return_data (bool, optional) – If True, returns the plot axes and the aggregated data used for plotting. Default is False.

  • figkwargs (dict, optional) – Additional keyword arguments for figure creation. Default is an empty dictionary.

Returns:

The plot axes. If return_data is True, returns a tuple of the plot axes and the aggregated DataFrame.

Return type:

matplotlib.axes.Axes or tuple