def seasonal_plot(grouped_x, xticklabels, ylabel=None, ax=None):
 (fig, ax) = utils.create_mpl_ax(ax)
 start = 0
 ticks = []
 for (season, df) in grouped_x:
  df = df.copy()
  df.sort_index()
  nobs = len(df)
  x_plot = np.arange(start, (start + nobs))
  ticks.append(x_plot.mean())
  ax.plot(x_plot, df.values, 'k')
  ax.hlines(df.values.mean(), x_plot[0], x_plot[(-1)], colors='r', linewidth=3)
  start += nobs
 ax.set_xticks(ticks)
 ax.set_xticklabels(xticklabels)
 ax.set_ylabel(ylabel)
 ax.margins(0.1, 0.05)
 return fig

def seasonal_plot ( grouped_x , xticklabels , ylabel = None , ax = None ) : ( fig , ax ) = utils . create_mpl_ax ( ax ) start = 0 ticks = [ ] for ( season , df ) in grouped_x : df = df . copy ( ) df . sort_index ( ) nobs = len ( df ) x_plot = np . arange ( start , ( start + nobs ) ) ticks . append ( x_plot . mean ( ) ) ax . plot ( x_plot , df . values , 'k' ) ax . hlines ( df . values . mean ( ) , x_plot [ 0 ] , x_plot [ ( - 1 ) ] , colors = 'r' , linewidth = 3 ) start += nobs ax . set_xticks ( ticks ) ax . set_xticklabels ( xticklabels ) ax . set_ylabel ( ylabel ) ax . margins ( 0.1 , 0.05 ) return fig
consider using one of month_plot or quarter_plot unless you need irregular plotting .