4.5. cpforager.diagnostic.plot_ts_twinx

cpforager.diagnostic.plot_ts_twinx(ax, df, plot_params, var, title, var_lab, custom_locator=None, custom_formatter=None, scatter=True)

Plot timeserie of dataframe column designated by the value of var and var_f with two distinct axes.

Parameters:
  • ax (matplotlib.Axes) – plot axes.

  • df (pandas.DataFrame) – dataframe with a datetime column and the column designated by the value of var.

  • plot_params (dict) – plot parameters dictionary.

  • var (str) – name of the column in df.

  • title (str) – plot title.

  • var_lab (str) – y-axis label.

  • custom_locator (matplotlib.dates.DayLocator) – data locator.

  • custom_formatter (matplotlib.dates.DateFormatter) – date formatter.

  • scatter (bool) – scatter plot if True, line plot otherwise.

Useful to plot raw and filtered data on the same frame even if scales are different.