@@ -2299,73 +2299,18 @@ def xaxis_date(self, tz=None):
22992299
23002300 *tz* is the time zone to use in labeling dates. Defaults to rc value.
23012301 """
2302-
2303- xmin , xmax = self .dataLim .intervalx
2304- if xmin == 0. :
2305- # no data has been added - let's set the default datalim.
2306- # We should probably use a better proxy for the datalim
2307- # have been updated than the ignore setting
2308- dmax = today = datetime .date .today ()
2309- dmin = today - datetime .timedelta (days = 10 )
2310- self ._process_unit_info (xdata = (dmin , dmax ))
2311- dmin , dmax = self .convert_xunits ([dmin , dmax ])
2312- self .viewLim .intervalx = dmin , dmax
2313- self .dataLim .intervalx = dmin , dmax
2314-
2315- locator = self .xaxis .get_major_locator ()
2316- if not isinstance (locator , mdates .DateLocator ):
2317- locator = mdates .AutoDateLocator (tz )
2318- self .xaxis .set_major_locator (locator )
2319-
2320- # the autolocator uses the viewlim to pick the right date
2321- # locator, but it may not have correct viewlim before an
2322- # autoscale. If the viewlim is still zero..1, set it to the
2323- # datalim and the autoscaler will update it on request
2324- if self .viewLim .intervalx [0 ]== 0. :
2325- self .viewLim .intervalx = tuple (self .dataLim .intervalx )
2326- locator .refresh ()
2327-
2328- formatter = self .xaxis .get_major_formatter ()
2329- if not isinstance (formatter , mdates .DateFormatter ):
2330- formatter = mdates .AutoDateFormatter (locator , tz )
2331- self .xaxis .set_major_formatter (formatter )
2302+ # should be enough to inform the unit conversion interface
2303+ # dates are comng in
2304+ self .xaxis .update_units (datetime .date (2009 ,1 ,1 ))
23322305
23332306 def yaxis_date (self , tz = None ):
23342307 """Sets up y-axis ticks and labels that treat the y data as dates.
23352308
23362309 *tz* is the time zone to use in labeling dates. Defaults to rc value.
23372310 """
2338- ymin , ymax = self .dataLim .intervaly
2339- if ymin == 0. :
2340- # no data has been added - let's set the default datalim.
2341- # We should probably use a better proxy for the datalim
2342- # have been updated than the ignore setting
2343- dmax = today = datetime .date .today ()
2344- dmin = today - datetime .timedelta (days = 10 )
2345- self ._process_unit_info (ydata = (dmin , dmax ))
2346-
2347- dmin , dmax = self .convert_yunits ([dmin , dmax ])
2348- self .viewLim .intervaly = dmin , dmax
2349- self .dataLim .intervaly = dmin , dmax
2350-
2351-
2352- locator = self .yaxis .get_major_locator ()
2353- if not isinstance (locator , mdates .DateLocator ):
2354- locator = mdates .AutoDateLocator (tz )
2355- self .yaxis .set_major_locator (locator )
2356-
2357- # the autolocator uses the viewlim to pick the right date
2358- # locator, but it may not have correct viewlim before an
2359- # autoscale. If the viewlim is still zero..1, set it to the
2360- # datalim and the autoscaler will update it on request
2361- if self .viewLim .intervaly [0 ]== 0. :
2362- self .viewLim .intervaly = tuple (self .dataLim .intervaly )
2363- locator .refresh ()
2364-
2365- formatter = self .xaxis .get_major_formatter ()
2366- if not isinstance (formatter , mdates .DateFormatter ):
2367- formatter = mdates .AutoDateFormatter (locator , tz )
2368- self .yaxis .set_major_formatter (formatter )
2311+ # should be enough to inform the unit conversion interface
2312+ # dates are comng in
2313+ self .yaxis .update_units (datetime .date (2009 ,1 ,1 ))
23692314
23702315 def format_xdata (self , x ):
23712316 """
0 commit comments