def format_dateaxis(subplot, freq, index):
<EOL>if isinstance(index, ABCPeriodIndex):<EOL><INDENT>majlocator = TimeSeries_DateLocator(freq, dynamic_mode=True,<EOL>minor_locator=False,<EOL>plot_obj=subplot)<EOL>minlocator = TimeSeries_DateLocator(freq, dynamic_mode=True,<EOL>minor_locator=True,<EOL>plot_obj=subplot)<EOL>subplot.xaxis.set_major_locator(majlocator)<EOL>subplot.xaxis.set_minor_locator(minlocator)<EOL>majformatter = TimeSeries_DateFormatter(freq, dynamic_mode=True,<EOL>minor_locator=False,<EOL>plot_obj=subplot)<EOL>minformatter = TimeSeries_DateFormatter(freq, dynamic_mode=True,<EOL>minor_locator=True,<EOL>plot_obj=subplot)<EOL>subplot.xaxis.set_major_formatter(majformatter)<EOL>subplot.xaxis.set_minor_formatter(minformatter)<EOL>subplot.format_coord = functools.partial(_format_coord, freq)<EOL><DEDENT>elif isinstance(index, ABCTimedeltaIndex):<EOL><INDENT>subplot.xaxis.set_major_formatter(<EOL>TimeSeries_TimedeltaFormatter())<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>pylab.draw_if_interactive()<EOL>
Pretty-formats the date axis (x-axis).

Major and minor ticks are automatically set for the frequency of the
current underlying series.  As the dynamic mode is activated by
default, changing the limits of the x axis will intelligently change
the positions of the ticks.