MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / axis_date

Method axis_date

lib/matplotlib/axis.py:2422–2437  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers 2

test_date_not_emptyFunction · 0.80

Calls 1

update_unitsMethod · 0.95

Tested by 2

test_date_not_emptyFunction · 0.64