code: def tsplot(series, plotf, ax=None, **kwargs):
      import warnings
  
      """
      Plots a Series on the given Matplotlib axes or the current axes
  
      Parameters
      ----------
      axes : Axes
      series : Series
  
      Notes
      _____
      Supports same kwargs as Axes.plot
  
  
      .. deprecated:: 0.23.0
         Use Series.plot() instead
      """
      warnings.warn(
          "'tsplot' is deprecated and will be removed in a "
          "future version. Please use Series.plot() instead.",
          FutureWarning,
          stacklevel=2,
      )
  
      # Used inferred freq is possible, need a test case for inferred
      if ax is None:
          import matplotlib.pyplot as plt
  
          ax = plt.gca()
  
      freq, series = _maybe_resample(series, ax, kwargs)
  
      # Set ax with freq info
      _decorate_axes(ax, freq, kwargs)
      ax._plot_data.append((series, plotf, kwargs))
      lines = plotf(
          ax, series.index._mpl_repr(), series.values, **kwargs
      )
  
      # set date formatter, locators and rescale limits
      format_dateaxis(ax, ax.freq, series.index)
      return lines
  
imports: import functools
  from matplotlib import pylab
  import numpy
  from pandas._libs.tslibs.frequencies import FreqGroup, get_base_alias, get_freq, is_subperiod, is_superperiod
  from pandas._libs.tslibs.period import Period
  import pandas.compat
  from pandas.core.dtypes.generic import ABCDatetimeIndex, ABCPeriodIndex, ABCTimedeltaIndex
  from pandas.io.formats.printing import pprint_thing
  from pandas.plotting._converter import TimeSeries_DateFormatter, TimeSeries_DateLocator, TimeSeries_TimedeltaFormatter
  import pandas.tseries.frequencies
  from pandas.tseries.offsets import DateOffset
label_desc: Use image node_id 1 for calling a global function with example usage: tsplot(series, plotf, ax) and returns: lines