pytrnsys_process.plot.plot_wrappers.histogram#

pytrnsys_process.plot.plot_wrappers.histogram(df: DataFrame, columns: list[str], use_legend: bool = True, size: tuple[float, float] = (7.8, 3.9), bins: int = 50, **kwargs: Any) tuple[Figure, Axes][source]#

Create a histogram from the given DataFrame columns.

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

  • columns (list of str) – names of columns to plot

  • use_legend (bool, default 'True') – whether to show the legend or not

  • size (tuple of (float, float)) – size of the figure (width, height)

  • bins (int) – number of histogram bins to be used

  • **kwargs – Additional keyword arguments to pass on to pandas.DataFrame.plot().

Return type:

tuple of (matplotlib.figure.Figure, matplotlib.axes.Axes)

Examples

>>> api.histogram(simulation.hourly, ["QSrc1TIn"], ylabel="")
../../_images/pytrnsys_process-plot-plot_wrappers-histogram-1.png