@@ -296,6 +296,7 @@ def format_dateaxis(subplot, freq, index):
296
296
the positions of the ticks.
297
297
"""
298
298
299
+ # handle index specific formatting
299
300
if isinstance (index , PeriodIndex ):
300
301
301
302
majlocator = TimeSeries_DateLocator (freq , dynamic_mode = True ,
@@ -316,15 +317,18 @@ def format_dateaxis(subplot, freq, index):
316
317
subplot .xaxis .set_major_formatter (majformatter )
317
318
subplot .xaxis .set_minor_formatter (minformatter )
318
319
319
- # x and y coord info
320
- subplot .format_coord = lambda t , y : (
321
- "t = {0} y = {1:8f}" .format (Period (ordinal = int (t ), freq = freq ), y ))
322
-
323
- pylab .draw_if_interactive ()
324
-
325
320
elif isinstance (index , TimedeltaIndex ):
326
321
from matplotlib import ticker
327
322
formatter = ticker .FuncFormatter (timeTicks )
328
323
subplot .xaxis .set_major_formatter (formatter )
329
324
else :
330
325
raise IOError ('index type not supported' )
326
+
327
+ # Note, DatetimeIndex does not use this
328
+ # interface. DatetimeIndex uses matplotlib.date directly
329
+
330
+ # x and y coord info
331
+ subplot .format_coord = lambda t , y : (
332
+ "t = {0} y = {1:8f}" .format (Period (ordinal = int (t ), freq = freq ), y ))
333
+
334
+ pylab .draw_if_interactive ()
0 commit comments