Set up axis ticks and labels to treat data along this Axis as dates. Parameters ---------- tz : str or `datetime.tzinfo`, default: :rc:`timezone` The timezone used to create date labels.
(self, tz=None)
| 2420 | raise NotImplementedError('Derived must override') |
| 2421 | |
| 2422 | def axis_date(self, tz=None): |
| 2423 | """ |
| 2424 | Set up axis ticks and labels to treat data along this Axis as dates. |
| 2425 | |
| 2426 | Parameters |
| 2427 | ---------- |
| 2428 | tz : str or `datetime.tzinfo`, default: :rc:`timezone` |
| 2429 | The timezone used to create date labels. |
| 2430 | """ |
| 2431 | # By providing a sample datetime instance with the desired timezone, |
| 2432 | # the registered converter can be selected, and the "units" attribute, |
| 2433 | # which is the timezone, can be set. |
| 2434 | if isinstance(tz, str): |
| 2435 | import dateutil.tz |
| 2436 | tz = dateutil.tz.gettz(tz) |
| 2437 | self.update_units(datetime.datetime(2009, 1, 1, 0, 0, 0, 0, tz)) |
| 2438 | |
| 2439 | def get_tick_space(self): |
| 2440 | """Return the estimated number of ticks that can fit on the axis.""" |