code: def _replot_ax(ax, freq, kwargs):
      data = getattr(ax, "_plot_data", None)
  
      # clear current axes and data
      ax._plot_data = []
      ax.clear()
  
      _decorate_axes(ax, freq, kwargs)
  
      lines = []
      labels = []
      if data is not None:
          for series, plotf, kwds in data:
              series = series.copy()
              idx = series.index.asfreq(freq, how="S")
              series.index = idx
              ax._plot_data.append((series, plotf, kwds))
  
              # for tsplot
              if isinstance(plotf, compat.string_types):
                  from pandas.plotting._core import _plot_klass
  
                  plotf = _plot_klass[plotf]._plot
  
              lines.append(
                  plotf(
                      ax,
                      series.index._mpl_repr(),
                      series.values,
                      **kwds,
                  )[0]
              )
              labels.append(pprint_thing(series.name))
  
      return lines, labels
  
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 6 for calling a global function with example usage: _replot_ax(ax, freq, kwargs) and returns: lines,  labels