# Buggy code
def tsplot(series, plotf, *args, **kwargs):
    """
    Plots a Series on the given Matplotlib axes object

    Parameters
    ----------
    axes : Axes
    series : Series

    Notes
    _____
    Supports same args and kwargs as Axes.plot

    """
    # Used inferred freq is possible, need a test case for inferred
    freq = getattr(series.index, "freq", None)
    if freq is None and hasattr(series.index, "inferred_freq"):
        freq = series.index.inferred_freq

    if isinstance(freq, DateOffset):
        freq = freq.rule_code

    freq = frequencies.to_calendar_freq(freq)
    # Convert DatetimeIndex to PeriodIndex
    if isinstance(series.index, DatetimeIndex):
        idx = series.index.to_period(freq=freq)
        series = Series(series.values, idx, name=series.name)

    if not isinstance(series.index, PeriodIndex):
        # try to get it to DatetimeIndex then to period
        if series.index.inferred_type == "datetime":
            idx = DatetimeIndex(series.index).to_period(freq=freq)
            series = Series(series.values, idx, name=series.name)
        else:
            raise TypeError(
                "series argument to tsplot must have DatetimeIndex or PeriodIndex"
            )

    if freq != series.index.freq:
        series = series.asfreq(freq)

    series = series.dropna()

    if "ax" in kwargs:
        ax = kwargs.pop("ax")
    else:
        ax = plt.gca()

    # Specialized ts plotting attributes for Axes
    ax.freq = freq
    xaxis = ax.get_xaxis()
    xaxis.freq = freq
    xaxis.converter = DateConverter
    ax.legendlabels = [kwargs.get("label", None)]
    ax.view_interval = None
    ax.date_axis_info = None

    # format args and lot
    args = _check_plot_params(series, series.index, freq, *args)
    plotted = plotf(ax, *args, **kwargs)

    format_dateaxis(ax, ax.freq)

    # when adding a right axis (using add_yaxis), for some reason the
    # x axis limits don't get properly set. This gets around the problem
    xlim = ax.get_xlim()
    if xlim[0] == 0.0 and xlim[1] == 1.0:
        # if xlim still at default values, autoscale the axis
        ax.autoscale_view()

    left = series.index[0]  # get_datevalue(series.index[0], freq)
    right = series.index[-1]  # get_datevalue(series.index[-1], freq)
    ax.set_xlim(left, right)

    return plotted


# Traceback (AttributeError)
In [4]: ts.plot()
Out[4]: <matplotlib.axes.AxesSubplot at 0x41cc310>

In [5]: ts.index.fr
ts.index.freq     ts.index.freqstr

In [5]: ts.index.freq
Out[5]: <10 Days>

In [6]: ts.index.freq = None
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/wesm/Dropbox/book/svn/<ipython-input-6-d89557d7f8e5> in <module>()
----> 1 ts.index.freq = None

AttributeError: can't set attribute

In [7]: ts.index.offset = None

In [8]: ts
Out[8]:
2000-01-01    2.963378
2000-01-11   -0.685998
2000-01-21    0.392812
2000-01-31   -0.143893
2000-02-10   -1.162283
2000-02-20   -0.460511
2000-03-01   -0.751741
2000-03-11   -0.567428
2000-03-21   -0.439105
2000-03-31    0.040322
2000-04-10   -0.929786
2000-04-20   -0.620005
2000-04-30    0.482502
2000-05-10    0.109013
2000-05-20    0.657817
2000-05-30   -0.668386
2000-06-09   -1.797074
2000-06-19   -0.197738
2000-06-29   -0.312481
2000-07-09    1.240477
2000-07-19    0.447583
2000-07-29    0.188429
2000-08-08   -0.117540
2000-08-18   -1.145495
2000-08-28    0.479124
2000-09-07    0.309968
2000-09-17    0.769928
2000-09-27   -0.501629
2000-10-07    0.164322
2000-10-17   -0.554113
2000-10-27    0.468588
2000-11-06    0.857458
2000-11-16    0.508256
2000-11-26   -0.452384
2000-12-06    1.732538
2000-12-16    0.695495
2000-12-26    0.441233
2001-01-05   -0.271561

In [9]: ts.index.offset = None

In [10]: ts.plot()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/wesm/Dropbox/book/svn/<ipython-input-10-132f3667ee95> in <module>()
----> 1 ts.plot()

/home/wesm/code/pandas/pandas/tools/plotting.pyc in plot_series(series, label, kind, use_index, rot, xticks, yticks, xlim, ylim, ax, style, grid, logy, **kwds)
758                      legend=False, grid=grid, label=label, **kwds)
759
--> 760     plot_obj.generate()
761     plot_obj.draw()
762

/home/wesm/code/pandas/pandas/tools/plotting.pyc in generate(self)
239         self._compute_plot_data()
240         self._setup_subplots()
--> 241         self._make_plot()
242         self._post_plot_logic()
243         self._adorn_subplots()

/home/wesm/code/pandas/pandas/tools/plotting.pyc in _make_plot(self)
426         if self.use_index and self.has_ts_index:
427             data = self._maybe_convert_index(self.data)
--> 428             self._make_ts_plot(data)
429         else:
430             x = self._get_xticks()

/home/wesm/code/pandas/pandas/tools/plotting.pyc in _make_ts_plot(self, data, **kwargs)
478
479             label = com._stringify(self.label)
--> 480             tsplot(data, plotf, ax=ax, label=label, **kwargs)
481             ax.grid(self.grid)
482         else:

/home/wesm/code/pandas/pandas/tseries/plotting.pyc in tsplot(series, plotf, *args, **kwargs)
114     # format args and lot
115     args = _check_plot_params(series, series.index, freq, *args)
--> 116     plotted = plotf(ax, *args,  **kwargs)
117
118     format_dateaxis(ax, ax.freq)

/home/wesm/code/repos/matplotlib/lib/matplotlib/axes.pyc in plot(self, *args, **kwargs)
3892         lines = []
3893
-> 3894         for line in self._get_lines(*args, **kwargs):
3895             self.add_line(line)
3896             lines.append(line)

/home/wesm/code/repos/matplotlib/lib/matplotlib/axes.pyc in _grab_next_args(self, *args, **kwargs)
321                 return
322             if len(remaining) <= 3:
--> 323                 for seg in self._plot_args(remaining, kwargs):
324                     yield seg
325                 return

/home/wesm/code/repos/matplotlib/lib/matplotlib/axes.pyc in _plot_args(self, tup, kwargs)
299             x = np.arange(y.shape[0], dtype=float)
300
--> 301         x, y = self._xy_from_xy(x, y)
302
303         if self.command == 'plot':

/home/wesm/code/repos/matplotlib/lib/matplotlib/axes.pyc in _xy_from_xy(self, x, y)
215     def _xy_from_xy(self, x, y):
216         if self.axes.xaxis is not None and self.axes.yaxis is not None:
--> 217             bx = self.axes.xaxis.update_units(x)
218             by = self.axes.yaxis.update_units(y)
219

/home/wesm/code/repos/matplotlib/lib/matplotlib/axis.pyc in update_units(self, data)
1276         """
1277
-> 1278         converter = munits.registry.get_converter(data)
1279         if converter is None:
1280             return False

/home/wesm/code/repos/matplotlib/lib/matplotlib/units.pyc in get_converter(self, x)
131
132         if converter is None and iterable(x):
--> 133             for thisx in x:
134                 # Make sure that recursing might actually lead to a solution, if
135                 # we are just going to re-examine another item of the same kind,

/home/wesm/code/pandas/pandas/tseries/period.pyc in __iter__(self)
685     def __iter__(self):
686         for val in self.values:
--> 687             yield Period(ordinal=val, freq=self.freq)
688
689     @property

/home/wesm/code/pandas/pandas/tseries/period.pyc in __init__(self, value, freq, ordinal, year, month, quarter, day, hour, minute, second)
136         base, mult = _gfc(freq)
137         if mult != 1:
--> 138             raise ValueError('Only mult == 1 supported')
139
140         if self.ordinal is None:

ValueError: Only mult == 1 supported

# Fixed code
def tsplot(series, plotf, *args, **kwargs):
    """
    Plots a Series on the given Matplotlib axes object

    Parameters
    ----------
    axes : Axes
    series : Series

    Notes
    _____
    Supports same args and kwargs as Axes.plot

    """
    # Used inferred freq is possible, need a test case for inferred
    freq = getattr(series.index, "freq", None)
    if freq is None and hasattr(series.index, "inferred_freq"):
        freq = series.index.inferred_freq

    if isinstance(freq, DateOffset):
        freq = freq.rule_code
    else:
        freq = frequencies.get_base_alias(freq)

    freq = frequencies.to_calendar_freq(freq)
    # Convert DatetimeIndex to PeriodIndex
    if isinstance(series.index, DatetimeIndex):
        idx = series.index.to_period(freq=freq)
        series = Series(series.values, idx, name=series.name)

    if not isinstance(series.index, PeriodIndex):
        # try to get it to DatetimeIndex then to period
        if series.index.inferred_type == "datetime":
            idx = DatetimeIndex(series.index).to_period(freq=freq)
            series = Series(series.values, idx, name=series.name)
        else:
            raise TypeError(
                "series argument to tsplot must have DatetimeIndex or PeriodIndex"
            )

    if freq != series.index.freq:
        series = series.asfreq(freq)

    series = series.dropna()

    if "ax" in kwargs:
        ax = kwargs.pop("ax")
    else:
        ax = plt.gca()

    # Specialized ts plotting attributes for Axes
    ax.freq = freq
    xaxis = ax.get_xaxis()
    xaxis.freq = freq
    xaxis.converter = DateConverter
    ax.legendlabels = [kwargs.get("label", None)]
    ax.view_interval = None
    ax.date_axis_info = None

    # format args and lot
    args = _check_plot_params(series, series.index, freq, *args)
    plotted = plotf(ax, *args, **kwargs)

    format_dateaxis(ax, ax.freq)

    # when adding a right axis (using add_yaxis), for some reason the
    # x axis limits don't get properly set. This gets around the problem
    xlim = ax.get_xlim()
    if xlim[0] == 0.0 and xlim[1] == 1.0:
        # if xlim still at default values, autoscale the axis
        ax.autoscale_view()

    left = series.index[0]  # get_datevalue(series.index[0], freq)
    right = series.index[-1]  # get_datevalue(series.index[-1], freq)
    ax.set_xlim(left, right)

    return plotted