mpl_bsic.format_timeseries_axis#
- mpl_bsic.format_timeseries_axis(ax, time_unit, freq, fmt=None)[source]#
Format the x-axis of a timeseries plot.
It sets the major locator and formatter for the x-axis. Note that this function does not take as an input the figure, but just the matplotlib Axes instance.
- Parameters:
- ax
matplotlib.axes.Axes
Matplotlib Axes instance.
- time_unit
Literal
[‘Y’, ‘M’, ‘W’, ‘D’] Time unit to use. Can be “Y” for years, “M” for months, ‘W’ for weeks, or “D” for days.
- freq
int
Time Frequency. For example, if time_unit is “M” and freq is 3, then the x-axis will have a tick every 3 months.
- fmt
str
|None
Date Format which will be fed to matplotlib.dates.DateFormatter. If None, the default format will be used (%b-%y).
- ax
- Raises:
Exception
If the time frequency is not supported.
See also
mpl_bsic.apply_BSIC_style
The function that applies the style to the plot.
Examples
Examples will come soon.