def format_dateaxis(subplot, freq):
 majlocator = TimeSeries_DateLocator(freq, dynamic_mode=True, minor_locator=False, plot_obj=subplot)
 minlocator = TimeSeries_DateLocator(freq, dynamic_mode=True, minor_locator=True, plot_obj=subplot)
 subplot.xaxis.set_major_locator(majlocator)
 subplot.xaxis.set_minor_locator(minlocator)
 majformatter = TimeSeries_DateFormatter(freq, dynamic_mode=True, minor_locator=False, plot_obj=subplot)
 minformatter = TimeSeries_DateFormatter(freq, dynamic_mode=True, minor_locator=True, plot_obj=subplot)
 subplot.xaxis.set_major_formatter(majformatter)
 subplot.xaxis.set_minor_formatter(minformatter)
 subplot.format_coord = (lambda t, y: 't = {0}  y = {1:8f}'.format(Period(ordinal=int(t), freq=freq), y))
 pylab.draw_if_interactive()

def format_dateaxis ( subplot , freq ) : majlocator = TimeSeries_DateLocator ( freq , dynamic_mode = True , minor_locator = False , plot_obj = subplot ) minlocator = TimeSeries_DateLocator ( freq , dynamic_mode = True , minor_locator = True , plot_obj = subplot ) subplot . xaxis . set_major_locator ( majlocator ) subplot . xaxis . set_minor_locator ( minlocator ) majformatter = TimeSeries_DateFormatter ( freq , dynamic_mode = True , minor_locator = False , plot_obj = subplot ) minformatter = TimeSeries_DateFormatter ( freq , dynamic_mode = True , minor_locator = True , plot_obj = subplot ) subplot . xaxis . set_major_formatter ( majformatter ) subplot . xaxis . set_minor_formatter ( minformatter ) subplot . format_coord = ( lambda t , y : 't = {0}  y = {1:8f}' . format ( Period ( ordinal = int ( t ) , freq = freq ) , y ) ) pylab . draw_if_interactive ( )
pretty-formats the date axis .