libb.numpy_timeseries_plot

numpy_timeseries_plot(title, dates, series=None, labels=None, formats=None)[source]

Create a matplotlib timeseries plot with automatic subplot layout.

The layout adapts based on the number of series:

  • 1 series: single plot

  • 2 series: same plot with dual y-axes (overlapping)

  • 3+ series: stacked vertically as subplots

Parameters:
  • title (str) – Plot title.

  • dates – Array of dates for x-axis.

  • series (list) – List of y-value arrays.

  • labels (list) – Labels for each series.

  • formats (list) – Formatter functions for each y-axis.

Returns:

BytesIO buffer containing the PNG image.

Return type:

BytesIO