Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/dates.cpython-312.pyc
T

876 lines
74 KiB
Plaintext
Raw Normal View History

Ë
†Rjãó^dZddlZddlZddlZddlZddlmZmZmZm Z m
Z
m Z m Z m
Z
mZmZmZmZmZmZmZddlmZddlZddlZddlZddlZddlmZmZm Z m!Z!dZ"ejFe$«Z%ejLjNZ(dCdZ)e*ejdd d «jW««Z,ed zZ-d
Z.d Z/d Z0d Z1d
Z2dZ3dZ4e/e.zZ5e0e/zZ6e6e.zZ7e7e2zZ8de7zZ9eee e
e e e
f\Z:Z;Z<Z=Z>Z?Z@e:e;e<e=e>e?e@fZAdaBdZCdZDdZEdZFdCdZGejeGd¬«ZIejej”j–«ZLdCdZMdZNdCdZOejdd¬«ZPdZQdZRdZSGdd e j¨«ZUGd!„d"e j¨«ZVGd#„d$e j¨«ZWGd%„d&«ZXGd'„d(e j²«ZZGd)„d*eZ«Z[Gd+„d,eZ«Z\Gd-„d.e[«Z]Gd/„d0e[«Z^Gd1„d2e[«Z_Gd3„d4e[«Z`Gd5„d6e[«ZaGd7„d8e[«ZbGd9„d:e[«ZcGd;„d<eZ«ZdGd=„d>e!jÊ«ZfGd?„d@ef«ZgGdA„dB«Zheh«xe!jÒe<xe!jÒe<e!jÒej<y)Da‰
Matplotlib provides sophisticated date plotting capabilities, standing on the
shoulders of python :mod:`datetime` and the add-on module dateutil_.
By default, Matplotlib uses the units machinery described in
`~matplotlib.units` to convert `datetime.datetime`, and `numpy.datetime64`
objects when plotted on an x- or y-axis. The user does not
need to do anything for dates to be formatted, but dates often have strict
formatting needs, so this module provides many tick locators and formatters.
A basic example using `numpy.datetime64` is::
import numpy as np
times = np.arange(np.datetime64('2001-01-02'),
np.datetime64('2002-02-03'), np.timedelta64(75, 'm'))
y = np.random.randn(len(times))
fig, ax = plt.subplots()
ax.plot(times, y)
.. seealso::
- :doc:`/gallery/text_labels_and_annotations/date`
- :doc:`/gallery/ticks/date_concise_formatter`
- :doc:`/gallery/ticks/date_demo_convert`
.. _date-format:
Matplotlib date format
----------------------
Matplotlib represents dates using floating point numbers specifying the number
of days since a default epoch of 1970-01-01 UTC; for example,
1970-01-01, 06:00 is the floating point number 0.25. The formatters and
locators require the use of `datetime.datetime` objects, so only dates between
year 0001 and 9999 can be represented. Microsecond precision
is achievable for (approximately) 70 years on either side of the epoch, and
20 microseconds for the rest of the allowable range of dates (year 0001 to
9999). The epoch can be changed at import time via `.dates.set_epoch` or
:rc:`date.epoch` to other dates if necessary; see
:doc:`/gallery/ticks/date_precision_and_epochs` for a discussion.
.. note::
Before Matplotlib 3.3, the epoch was 0000-12-31 which lost modern
microsecond precision and also made the default axis limit of 0 an invalid
datetime. In 3.3 the epoch was changed as above. To convert old
ordinal floats to the new epoch, users can do::
new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31'))
There are a number of helper functions to convert between :mod:`datetime`
objects and Matplotlib dates:
.. currentmodule:: matplotlib.dates
.. autosummary::
:nosignatures:
datestr2num
date2num
num2date
num2timedelta
drange
set_epoch
get_epoch
.. note::
Like Python's `datetime.datetime`, Matplotlib uses the Gregorian calendar
for all conversions between dates and floating point numbers. This practice
is not universal, and calendar differences can cause confusing
differences between what Python and Matplotlib give as the number of days
since 0001-01-01 and what other software and databases yield. For
example, the US Naval Observatory uses a calendar that switches
from Julian to Gregorian in October, 1582. Hence, using their
calculator, the number of days between 0001-01-01 and 2006-04-01 is
732403, whereas using the Gregorian calendar via the datetime
module we find::
In [1]: date(2006, 4, 1).toordinal() - date(1, 1, 1).toordinal()
Out[1]: 732401
All the Matplotlib date converters, locators and formatters are timezone aware.
If no explicit timezone is provided, :rc:`timezone` is assumed, provided as a
string. If you want to use a different timezone, pass the *tz* keyword
argument of `num2date` to any date tick locators or formatters you create. This
can be either a `datetime.tzinfo` instance or a string with the timezone name
that can be parsed by `~dateutil.tz.gettz`.
A wide range of specific and general purpose date tick locators and
formatters are provided in this module. See
:mod:`matplotlib.ticker` for general information on tick locators
and formatters. These are described below.
The dateutil_ module provides additional code to handle date ticking, making it
easy to place ticks on any kinds of dates. See examples below.
.. _dateutil: https://dateutil.readthedocs.io
.. _date-locators:
Date tick locators
------------------
Most of the date tick locators can locate single or multiple ticks. For example::
# import constants for the days of the week
from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
# tick on Mondays every week
loc = WeekdayLocator(byweekday=MO, tz=tz)
# tick on Mondays and Saturdays
loc = WeekdayLocator(byweekday=(MO, SA))
In addition, most of the constructors take an interval argument::
# tick on Mondays every second week
loc = WeekdayLocator(byweekday=MO, interval=2)
The rrule locator allows completely general date ticking::
# tick every 5th easter
rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
loc = RRuleLocator(rule)
The available date tick locators are:
* `MicrosecondLocator`: Locate microseconds.
* `SecondLocator`: Locate seconds.
* `MinuteLocator`: Locate minutes.
* `HourLocator`: Locate hours.
* `DayLocator`: Locate specified days of the month.
* `WeekdayLocator`: Locate days of the week, e.g., MO, TU.
* `MonthLocator`: Locate months, e.g., 7 for July.
* `YearLocator`: Locate years that are multiples of base.
* `RRuleLocator`: Locate using a `rrulewrapper`.
`rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule`
which allow almost arbitrary date tick specifications.
See :doc:`rrule example </gallery/ticks/date_demo_rrule>`.
* `AutoDateLocator`: On autoscale, this class picks the best `DateLocator`
(e.g., `RRuleLocator`) to set the view limits and the tick locations. If
called with ``interval_multiples=True`` it will make ticks line up with
sensible multiples of the tick intervals. For example, if the interval is
4 hours, it will pick hours 0, 4, 8, etc. as ticks. This behaviour is not
guaranteed by default.
.. _date-formatters:
Date formatters
---------------
The available date formatters are:
* `AutoDateFormatter`: attempts to figure out the best format to use. This is
most useful when used with the `AutoDateLocator`.
* `ConciseDateFormatter`: also attempts to figure out the best format to use,
and to make the format as compact as possible while still having complete
date information. This is most useful when used with the `AutoDateLocator`.
* `DateFormatter`: use `~datetime.datetime.strftime` format strings.
éN)ÚrruleÚMOÚTUÚWEÚTHÚFRÚSAÚSUÚYEARLYÚMONTHLYÚWEEKLYÚDAILYÚHOURLYÚMINUTELYÚSECONDLY)Ú
relativedelta)Ú_apiÚcbookÚtickerÚunits))Ú datestr2numÚdate2numÚnum2dateÚ
num2timedeltaÚdrangeÚ set_epochÚ get_epochÚ
DateFormatterÚConciseDateFormatterÚAutoDateFormatterÚ DateLocatorÚ RRuleLocatorÚAutoDateLocatorÚ YearLocatorÚ MonthLocatorÚWeekdayLocatorÚ
DayLocatorÚ HourLocatorÚ
MinuteLocatorÚ
SecondLocatorÚMicrosecondLocatorrrrrrrr r
r r r
rrrrÚ
MICROSECONDLYrÚ
DateConverterÚConciseDateConverterÚ rrulewrappercótj|d«}|dk(rtSt|t«r1t
j j|«}|t|d«|St|tj«r|Std|d«)
Generate `~datetime.tzinfo` from a string or return `~datetime.tzinfo`.
If None, retrieve the preferred timezone from the rcParams dictionary.
ÚtimezoneÚUTCz8 is not a valid timezone as parsed by dateutil.tz.gettz.z*tz must be string or tzinfo subclass, not ú.) ÚmplÚ
_val_or_rcr2Ú
isinstanceÚstrÚdateutilÚtzÚgettzÚ
ValueErrorÚdatetimeÚtzinfoÚ TypeError)r9r=s úS/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/dates.pyÚ _get_tzinfor@Ðsô
˜˜JÓ '€BØ ˆUˆ
Ü"”cÔÜ×" &ˆØ ˆ ˜$3ð
ˆ
Ü"”h—oˆ Ü
ÐÀÀaÐ
é²ég8@gN@g(@g@g>@gÐv@瀄.Acóday)zj
Reset the Matplotlib date epoch so it can be set again.
Only for use in tests and examples.
N)Ú_epoch©rAr?Ú_reset_epoch_test_examplerHs ðFrAcó*t td«|ay)
Set the epoch (origin for dates) for datetime calculations.
The default epoch is :rc:`date.epoch`.
If microsecond accuracy is desired, the date being plotted needs to be
within approximately 70 years of the epoch. Matplotlib internally
represents dates as days since the epoch, so floating point dynamic
range needs to be within a factor of 2^52.
`~.dates.set_epoch` must be called before any dates are converted
(i.e. near the import section) or a RuntimeError will be raised.
See also :doc:`/gallery/ticks/date_precision_and_epochs`.
Parameters
----------
epoch : str
valid UTC date parsable by `numpy.datetime64` (do not include
timezone).
Nz.set_epoch must be called before dates plotted.)rFÚ RuntimeError)Úepochs r?rr
sô0ÐÜÐ
FrAcóBtjtd«atS)z
Get the epoch used by `.dates`.
Returns
-------
epoch : str
String for the epoch (parsable by `numpy.datetime64`).
z
date.epoch)r4r5rFrGrAr?rr'sô^‰^œF 
1€FÜ €MrAcóú|jd«}||z
jd«}tjt«d«}||z
jtj«}||jtj«dz z
}|t
z }tjd«jtj «}|jtj «}tj|||k(<|S)a<
Convert `numpy.datetime64` or an `numpy.ndarray` of those types to
Gregorian date as UTC float relative to the epoch (see `.get_epoch`).
Roundoff is float64 precision. Practically: microseconds for dates
between 290301 BC, 294241 AD, milliseconds for larger dates
(see `numpy.datetime64`).
z
datetime64[s]ztimedelta64[ns]ÚsgeÍÍAÚNaT)ÚastypeÚnpÚ
datetime64rÚfloat64Ú SEC_PER_DAYÚint64Únan)ÚdsecondsÚextraÚt0ÚdtÚNaT_intÚd_ints r?Ú_dt64_to_ordinalfr^6ðx‰x˜Ó(€HØ
‰\× !Ð"3Ó 4€EÜ ”y“{ CÓ (€BØ
R‰-× Ñ ¤§
¡
Ó +€B؈%,‰,”r—z
" 
*€BØ ŒkÑ €Bäm‰m˜"×)¬"¯(©(Ó3€GØ
H‰H”R—X‘XÓ €EÜŸ6™6€B€uÑÑØ
€IrAc óît|«}tjt««tjt tj |tz««d«z}|tjd«ks|tjd«k\rtd|d|dt«d«|j«}|jtjjd«¬ «}|j|«}tj|«d
kDr]t
|j d z «d z}|d k(r+|jd
¬«t#j$d¬«z}|S|j|¬«}|S)ax
Convert Gregorian float of the date, preserving hours, minutes,
seconds and microseconds. Return value is a `.datetime`.
The input date *x* is a float in ordinal days at UTC, and the output will
be the specified `.datetime` object corresponding to that time in
timezone *tz*, or if *tz* is ``None``, in the timezone specified in
:rc:`timezone`.
Úusz
0001-01-01z 10000-01-01z
Date ordinal z
converts to z (using epoch z;), but Matplotlib dates must be between year 0001 and 9999.r2©r=éÎcéé@Br)Ú microsecondrC)Úseconds)r@rQrRrÚ timedelta64ÚintÚroundÚMUSECONDS_PER_DAYr;ÚtolistÚreplacer8r9r:Ú
astimezoneÚabsrer<Ú timedelta)Úxr9r[Úmss r?Ú_from_ordinalfrrNs@ô
R€Bä
-‰-œ Ó
.‰.œœRŸX™X aÔ*;Ñ&;Ó=¸
 E€Bà ŒBM‰M˜ '¨2´·±¸}Ó1MÒ+Mܘ=¨¨¨=¸¸ð="Ü"+£+ ð/8ð
€Bð
œ8Ÿ;™;×,¨UÓÓ 4€Bà €Bä ‡vvˆaƒyô2—>> 
'¨"Ñ
,ˆØ
Š=بÓ*¬X×-?Ñ-?ÈÔ-JÑJˆBð €Ið¨Ó+ˆBà
€IrAÚO)Úotypesc óŽt|t«r,tjj ||¬«}t |«S|L|Dcgc],}t tjj ||¬««Œ.}}t
j|«St
j|«}|js|St t|««Scc}w)a
Convert a date string to a datenum using `dateutil.parser.parse`.
Parameters
----------
d : str or sequence of str
The dates to convert.
default : datetime.datetime, optional
The default date to use when fields are missing in *d*.
©Údefault)
r6r7r8ÚparserÚparserrQÚasarrayÚsizeÚ$_dateutil_parser_parse_np_vectorized)rWrwr[rNs r?rr{ô!”SÔÜ
_‰_×
" 1¨gÐ
ܘ‹|Ðà Ð àöØôœ(Ÿ/™/׸7ЈAðä—:‘:˜a“=Ð Ü J‰Jq‹MˆØvŠv؈Ô<¸@ùò
sÁ1CcóÎtj|«}tj|«}|s|g}tjj |«}tjj
|«}tj|«}tj|jtj«sx|js|St|ddd«}|G|Dcgc]'}|jt«jd¬«Œ)}}tj|«}|j!d«}|r!tjj#||¬«n|}t%|«}|r|S|dScc}w)ac
Convert datetime objects to Matplotlib dates.
Parameters
----------
d : `datetime.datetime` or `numpy.datetime64` or sequences of these
Returns
-------
float or sequence of floats
Number of days since the epoch. See `.get_epoch` for the
epoch, which can be changed by :rc:`date.epoch` or `.set_epoch`. If
the epoch is "1970-01-01T00:00:00" (default) then noon Jan 1 1970
("1970-01-01T12:00:00") returns 0.5.
Notes
-----
The Gregorian calendar is assumed; this is not universal practice.
For details see the module docstring.
rr=Nrazdatetime64[us])Úmask)rÚ_unpack_to_numpyrQÚiterableÚmaÚ is_maskedÚgetmaskrzÚ
issubdtypeÚdtyperRr{Úgetattrrmr2rlrPÚ masked_arrayr^)rWr€Úmaskedr~Útzir[s r?rrsô, ×јqÓ!€Aô{‰{˜1‹~€HÙ Ø
ˆCˆä
U‰U_‰_˜
€FÜ
5‰5=‰=˜Ó €DÜ
1
€Aô =‰=˜Ÿ¤"§-¡-Ô vŠvàˆ‘d˜H dÓØ ˆ?àCDÖE¸RœsÓ+°4ÐEˆAÐ
˜1“
ˆ
H‰HÐ &ˆá,2Œ×ј1 4ÐÔ€Aܘ!Ó€Aáˆ"˜a ™dÐ"ùòFsÃ,E"cóLt|«}t||«j«S)a=
Convert Matplotlib dates to `~datetime.datetime` objects.
Parameters
----------
x : float or sequence of floats
Number of days (fraction part represents hours, minutes, seconds)
since the epoch. See `.get_epoch` for the
epoch, which can be changed by :rc:`date.epoch` or `.set_epoch`.
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Timezone of *x*. If a string, *tz* is passed to `dateutil.tz`.
Returns
-------
`~datetime.datetime` or sequence of `~datetime.datetime`
Dates are returned in timezone *tz*.
If *x* is a sequence, a sequence of `~datetime.datetime` objects will
be returned.
Notes
-----
The Gregorian calendar is assumed; this is not universal practice.
For details, see the module docstring.
)r@Ú_from_ordinalf_np_vectorizedrk)rpr9s r?rrÉs#ô4
R€BÜ ¨2Ó .× 7rAcó.tj|¬«S)N)Údays)r<ro©rps r?ú<lambda>rèsŒh× Ñ  aÔ(€rAcó4t|«j«S)a
Convert number of days to a `~datetime.timedelta` object.
If *x* is a sequence, a sequence of `~datetime.timedelta` objects will
be returned.
Parameters
----------
x : float, sequence of floats
Number of days. The fraction part represents hours, minutes, seconds.
Returns
-------
`datetime.timedelta` or list[`datetime.timedelta`]
)Ú$_ordinalf_to_timedelta_np_vectorizedrks r?rrësô Ó 2× ;rAcót|«}t|«}|j«tz }tt j
||z
|z ««}|||zz}||k\r
||z}|dz}t|«}t j |||dz«S)
Return a sequence of equally spaced Matplotlib dates.
The dates start at *dstart* and reach up to, but not including *dend*.
They are spaced by *delta*.
Parameters
----------
dstart, dend : `~datetime.datetime`
The date limits.
delta : `datetime.timedelta`
Spacing of the dates.
Returns
-------
`numpy.array`
A list floats representing Matplotlib dates.
rC)rÚ
total_secondsrTrhrQÚceilÚlinspace)ÚdstartÚdendÚdeltaÚf1Úf2ÚstepÚnumÚ
dinterval_ends r?rrþs˜ô(
€BÜ $‹€BØ × Ñ Ó ¤;Ñ .€Dô Œbg‰gr˜Bw 
(€Cð˜S 5™[Ñ(€Mð˜Òð ˜Ñˆ
Ø ˆq‰ˆä -Ó €BÜ
;‰;r˜2˜s Q™wÓ 'rAcóÔd}tj|d|«}|jdd«jdd«}|jdd«}d |zd
z}|jd d «}|S)
Nz ([a-zA-Z]+)z}$\1$\\mathdefault{ú-z{-}ú:z{:}ú z\;z$\mathdefault{z}$z$\mathdefault{}$Ú)ÚreÚsubrl)ÚtextÚret_texts r?Ú _wrap_in_texr¨'stØ€AÜv‰vÓ6€Hð×Ñ  UÓ3°C¸Ó?€Hà×Ñ  UÓ+€HØ  8Ñ+¨dÑ2€HØ×ÑÐ 3°RÓ8€HØ €OrAcó,eZdZdZdddœdZddZdZy) rzi
Format a tick (in days since the epoch) with a
`~datetime.datetime.strftime` format string.
Úusetexcóht|«|_||_tj|d«|_y)
Parameters
----------
fmt : str
`~datetime.datetime.strftime` format string
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
usetex : bool, default: :rc:`text.usetex`
To enable/disable the use of TeX's math mode for rendering the
results of the formatter.
ú text.usetexN)r@r9Úfmtr4r5Ú_usetex)Úselfr®r9s r?Ú__init__zDateFormatter.__init__=s(ô˜b“/ˆŒØˆŒÜ—~‘~ f¨mÓ<ˆ rAcó’t||j«j|j«}|jr t |«S|S©N)rr9Ústrftimer®)rpÚposÚresults r?Ú__call__zDateFormatter.__call__Ms7ܘ!˜TŸW™WÓ.¨t¯x©xÓ8ˆØ'+§|¢|Œ|˜?¸Ð?rAcó$t|«|_y©r@r9©r9s r?Ú
set_tzinfozDateFormatter.set_tzinfoQs
ܘb“/ˆrA)r)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r±rGrAr?rr7sñð
=¨tô@ó"rArcó<eZdZdZ d ddœdZd
dZdZdZdZy) r
A `.Formatter` which attempts to figure out the best format to use for the
date, and to make it as compact as possible, but still be complete. This is
most useful when used with the `AutoDateLocator`::
>>> locator = AutoDateLocator()
>>> formatter = ConciseDateFormatter(locator)
Parameters
----------
locator : `.ticker.Locator`
Locator that this axis is using.
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone, passed to `.dates.num2date`.
formats : list of 6 strings, optional
Format strings for 6 levels of tick labelling: mostly years,
months, days, hours, minutes, and seconds. Strings use
the same format codes as `~datetime.datetime.strftime`. Default is
``['%Y', '%b', '%d', '%H:%M', '%H:%M', '%S.%f']``
zero_formats : list of 6 strings, optional
Format strings for tick labels that are "zeros" for a given tick
level. For instance, if most ticks are months, ticks around 1 Jan 2005
will be labeled "Dec", "2005", "Feb". The default is
``['', '%Y', '%b', '%b-%d', '%H:%M', '%H:%M']``
offset_formats : list of 6 strings, optional
Format strings for the 6 levels that is applied to the "offset"
string found on the right side of an x-axis, or top of a y-axis.
Combined with the tick labels this should completely specify the
date. The default is::
['', '%Y', '%Y-%b', '%Y-%b-%d', '%Y-%b-%d', '%Y-%b-%d %H:%M']
show_offset : bool, default: True
Whether to show the offset or not.
usetex : bool, default: :rc:`text.usetex`
To enable/disable the use of TeX's math mode for rendering the results
of the formatter.
Examples
--------
See :doc:`/gallery/ticks/date_concise_formatter`
.. plot::
import datetime
import matplotlib.dates as mdates
base = datetime.datetime(2005, 2, 1)
dates = np.array([base + datetime.timedelta(hours=(2 * i))
for i in range(732)])
N = len(dates)
np.random.seed(19680801)
y = np.cumsum(np.random.randn(N))
fig, ax = plt.subplots(constrained_layout=True)
locator = mdates.AutoDateLocator()
formatter = mdates.ConciseDateFormatter(locator)
ax.xaxis.set_major_locator(locator)
ax.xaxis.set_major_formatter(formatter)
ax.plot(dates, y)
ax.set_title('Concise Date Formatter')
Nrªcóú||_||_d|_|r!t|«dk7r t d«||_n gd¢|_|r!t|«dk7r t d«||_nB|rdg|j
ddz|_n'dg|j
ddz|_d |j d
<|r!t|«dk7r t d «||_n gd ¢|_d|_||_ tj|d
«|_ y)z•
Autoformat the date labels. The default format is used to form an
initial string, and then redundant elements are removed.
ú%Yéz=formats argument must be a list of 6 format strings (or None))z%bz%dú%H:%MrÄz%S.%fzBzero_formats argument must be a list of 6 format strings (or None)r¢Néÿÿÿÿz%b-%dézDoffset_formats argument must be a list of 6 format strings (or None))z%Y-%bú%Y-%b-%drÇz%Y-%b-%d %H:%Mr­)
Ú_locatorÚ_tzÚ
defaultfmtÚlenr;ÚformatsÚ zero_formatsÚoffset_formatsÚ
offset_stringÚ show_offsetr4r5)Úlocatorr9s r?zConciseDateFormatter.__init__œsð  ˆŒ
؈ŒØˆŒñ Ü7‹|˜ Ü ð">ó"ˆDˆDŒLñ Ü   ð">ó?à ,ˆ Ù
à!#  t§|¡|°C°RÐ'8Ñ 8ˆ ð"$  t§|¡|°C°RÐ'8Ñ 8ˆ Ø#*ˆD× Ñ ˜ á Ü"  ð">ó?à"0ˆ ò#5ˆ ð  ˆÔØÔÜ—~~ f¨mÓ<ˆ rAcónt|j|j|j¬«}|||¬«S)Nrª))r)rpÚ formatters r?zConciseDateFormatter.__call__Ös,Ü! $§/¡/°4·8±8Ø)-¯©ô7ˆ ᘠÔ$rAcóª|Dcgc]}t||j¬«Œ}}tj|Dcgc]}|j «ddŒc}«}|j
}|j }|j}|j} tddd«D]U}
tj|dd|
f«} t| «dkDr!|
dkrtj| dk(«rd} n
|
dk(sŒTd}
ŒWgd ¢} d
gt|«z}
tt|««D]k}
dkr|||
| |
k(r||
}n9||
}n3||j||jcxk(rdk(r nn||
}n||
}||j|«|
|<Œm
dk\rRt!d |
D«d¬ «}|r<tt|
««D]%}d
|
|vsŒ |
|d| j#d
«|
|<Œ'| r¼|j$j&rc|j$j&j(dvrA|j$j&j+«r|dj||
«|_n|dj||
«|_|j.r"t1|j,«|_nd
|_|j.r|
Dcgc]
}t1|«Œc}S|
Scc}wcc}wcc}w)r9érCéFr)rrCrCrrrrc3órK|]/}d|vsŒt|«t|jd««z
Œ1y­w)r3Ú0N)Úrstrip)Ú.0rNs r?ú <genexpr>z4ConciseDateFormatter.format_ticks.<locals>.<genexpr>s,èø€ÒÀÀqÂQ“œ#˜aŸh™h s›mÓIùs 7Œ+7rvr3)ÚxaxisÚyaxis)rrQÚarrayÚ timetuplerÌÚrangeÚuniquerËÚanyÚsecondrer´ÚminrÚÚaxisr¼Ú get_invertedrÏ)ÚvaluesÚvalueÚ tickdatetimeÚtdtÚtickdateÚfmtsÚzerofmtsÚ
offsetfmtsrÐÚlevelrâÚzerovalsÚlabelsÚnnr®Útrailing_zerosÚls r?Ú format_ticksz!ConciseDateFormatter.format_ticksÛØBHÖœ ¨4¯8©8Ö Ð—8‘8¸LÖI°S˜SŸ]™]›_¨R¨aÒð|‰|ˆà×ð×
Ø×&ˆ ô
˜1˜b 
ˆEÜ—Y‘Y˜xª¨5¨Ñ2ˆFÜ6‹{˜QŠà˜1’9¤§¡¨°!© Ô!4Ø"'ؘ!“ðð
òØœ˜H›
Ñ%ˆÜœ˜H
Ó
8ˆqŠyؘB< Ñ&¨(°5©/Ò" 5™/˜u™+! Ñ$×+¨|¸BÑ/?×/KÑ/KôØõà" 5™/˜u™+% )×2°3Ó7ˆF2ŠJð
8ð( AŠ:Ü ÙI°fÔôˆNñܤ F£ ÓN˜f R™jÒ(Ø%+¨B¡ZÐ0@°.°Ð%A×%HÑ%HÈÓ%M˜˜
ðNñ à
×—MM×&×/Ð3EÑŸ
×*×9Ø%1°!¡_×%=Ñ%=¸Ñ>OÓ%PÕ"à%1°"Ñ%5×%>Ñ%>¸zÈ%Ñ?PÓ%QÔ|Š|Ü%1°$×2DÑ2DÓ%EÕ"à!#ˆ à <Š<Ø-3Ö”L •OÒ ˆMùòcJùÚIùò\5sK¸K Ê/Kcó|jS)©s r?Ú
get_offsetzConciseDateFormatter.get_offset/sØ×!rAcóNt||j¬«jd«S)NrÕz%Y-%m-%d %H:%M:%S)rr´)s r?Úformat_data_shortz&ConciseDateFormatter.format_data_short2sܘ $§(¡(Ô+×4Ð5HÓIrA)NNNNTr³) r¼r¿rGrAr?rrUs8ñDðLGKØ04ð8=Ø@Dô8=ót
RòhJrArcó,eZdZdZdddœdZdZddZy) r a
A `.Formatter` which attempts to figure out the best format to use. This
is most useful when used with the `AutoDateLocator`.
`.AutoDateFormatter` has a ``.scale`` dictionary that maps tick scales (the
interval in days between one major tick) to format strings; this dictionary
defaults to ::
self.scaled = {
DAYS_PER_YEAR: rcParams['date.autoformatter.year'],
DAYS_PER_MONTH: rcParams['date.autoformatter.month'],
1: rcParams['date.autoformatter.day'],
1 / HOURS_PER_DAY: rcParams['date.autoformatter.hour'],
1 / MINUTES_PER_DAY: rcParams['date.autoformatter.minute'],
1 / SEC_PER_DAY: rcParams['date.autoformatter.second'],
1 / MUSECONDS_PER_DAY: rcParams['date.autoformatter.microsecond'],
}
The formatter uses the format string corresponding to the lowest key in
the dictionary that is greater or equal to the current scale. Dictionary
entries can be customized::
locator = AutoDateLocator()
formatter = AutoDateFormatter(locator)
formatter.scaled[1/(24*60)] = '%M:%S' # only show min and sec
Custom callables can also be used instead of format strings. The following
example shows how to use a custom format function to strip trailing zeros
from decimal seconds and adds the date to the first ticklabel::
def my_format_function(x, pos=None):
x = matplotlib.dates.num2date(x)
if pos == 0:
fmt = '%D %H:%M:%S.%f'
else:
fmt = '%H:%M:%S.%f'
label = x.strftime(fmt)
label = label.rstrip("0")
label = label.rstrip(".")
return label
formatter.scaled[1/(24*60)] = my_format_function
NrªcóV||_||_||_t|j|«|_t
j }t j|d«|_t|dt|dd|ddtz |ddtz |ddtz |ddtz |d i|_y
) a.
Autoformat the date labels.
Parameters
----------
locator : `.ticker.Locator`
Locator that this axis is using.
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
defaultfmt : str
The default format to use if none of the values in ``self.scaled``
are greater than the unit returned by ``locator._get_unit()``.
usetex : bool, default: :rc:`text.usetex`
To enable/disable the use of TeX's math mode for rendering the
results of the formatter. If any entries in ``self.scaled`` are set
as functions, then it is up to the customized function to enable or
disable TeX's math mode itself.
r­zdate.autoformatter.yearzdate.autoformatter.monthrCzdate.autoformatter.dayzdate.autoformatter.hourzdate.autoformatter.minutezdate.autoformatter.secondzdate.autoformatter.microsecondN)rÚ
_formatterr4ÚrcParamsr5Ú
DAYS_PER_YEARÚDAYS_PER_MONTHÚ
HOURS_PER_DAYÚMINUTES_PER_DAYrTrjÚscaled)r9rÿs r?zAutoDateFormatter.__init__nð. ˆŒ
؈ŒØŒÜ¯©¸Ó<ˆŒÜ—<<ˆÜ—~~ f¨mÓ<ˆŒ ä ˜8Ð$=Ñ ˜HÐ%?Ñ
ˆ
Ñ ˜xÐ(AÑ
Ñ  Ð*EÑ!FØ
‰O˜XÐ&AÑ
Ô ! 8Ð,LÑ#Mð
ˆ rAcó||_y))s r?Ú _set_locatorzAutoDateFormatter._set_locator•s ؈
rAcóÎ t|jj««Št ˆfdt |j j««D«|j«}t|t«r;t||j|j¬«|_|j||«}|St|«r |||«}|St!d|d«#t$rdŠYŒ½wxYw)NrCc3ó2K|]\}}|k\r|Œy­wrG)Úscaler®Úlocator_unit_scales €r?z-AutoDateFormatter.__call__.<locals>.<genexpr>žs%øèø€ò4™J˜E 3ØÐ 2Òñ4ùsƒzUnexpected type passed to r3)ÚfloatrÈÚ _get_unitÚAttributeErrorÚnextÚsortedrÚitemsrÊr6r7rÚcallabler>)rpr
s @r?zAutoDateFormatter.__call__˜ø€ð #Ü!& t§}¡}×'>Ñ'>Ó'@Ó!AÐ ôó4¬&°·±×1BÑ1BÓ1DÓ*Eô—?ô cœ3Ô Ü+¨C°·±À$Ç,Á,ÔOˆDŒOØ—_‘_ Q¨Ó,ˆFð ˆ
ô cŒ]Ù˜˜C“[ˆFðˆ
ôиÀÐ Cøôò #Ø!"Ò ð #úsƒ#Cà C$Ã#C$)Nz%Y-%m-%dr³)r¿rrGrAr?r r 6s ñ*ðn%
Øô%
òN ôrAr có>eZdZdZd
dZdZdZdZd dZdZ d „Z
y) r/zd
A simple wrapper around a `dateutil.rrule` allowing flexible
date tick specifications.
Nc ó@||d<||_|jdi|¤Žy)
Parameters
----------
freq : {YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY}
Tick frequency. These constants are defined in `dateutil.rrule`,
but they are accessible from `matplotlib.dates` as well.
tzinfo : `datetime.tzinfo`, optional
Time zone information. The default is None.
**kwargs
Additional keyword arguments are passed to the `dateutil.rrule`.
ÚfreqNrG)Ú _base_tzinfoÚ
_update_rrule)rr=Úkwargss r?zrrulewrapper.__init__²s(ðˆˆv‰ØÔàˆ×ÑÑ$˜VÓ$rAc ór|jj|«|jdi|j¤Žy)z'Set parameters for an existing wrapper.NrG)Ú
_constructÚupdater)rs r?Úsetzrrulewrapper.setÃs+à ×јvÔˆ×ÑÑ-˜TŸ_™_Ó-rAc ó®|j}d|vrF|d}|j5|
|j}n|j|«}|jd¬«|d<d|vrE|d}|j4||j|«}n t d«|jd¬«|d<|j «|_||_tdi|j ¤Ž|_ y)dtstartraÚuntilz<until cannot be aware if dtstart is naive and tzinfo is NonerG)
rr=rmrlr;ÚcopyrÚ_tzinforÚ_rrule)rr=rrs r?rzrrulewrapper._update_rruleÉØ×"ˆð
˜Ñ ؘYÑ'ˆ~‰~Ð$Ÿ^™^%×Ó8Gà$+§O¡O¸4 OÓ$@  ؘ7Oˆ|‰|ÐÐ!×,¨VÓ4&CóDðDð#(§-¡-°t -Ó"<wà Ÿ+™+›-ˆŒØˆŒ ÜÑ.˜dŸo™oÑ rAcódt|d«r|j|d¬«S|j|¬«S)localizeT)Úis_dstra)Úhasattrr#rl)r[r=s r?Ú_attach_tzinfozrrulewrapper._attach_tzinfoès0ä 6˜ —?? 2¨d z‰z ˆ(rAcó’jSˆfdŠˆfdŠ|sˆˆˆfd}nˆˆˆfd}tj«|«S)z>Decorator function that allows rrule methods to handle tzinfo.cóÞt|tj«rQ|jE|jjur|j j«}|j d¬«S|S)Nra)r6r<r=r rmrl)Úargr°s €r?Ú
normalize_argz9rrulewrapper._aware_return_wrapper.<locals>.normalize_arg÷sTø€Ü˜#œx×1°c·j±jÐ6LØ—:‘: T§\¡\ÑŸ.™.¨¯©Ó6—{‘{¨$ˆJrAcó’tˆfd|D««}|j«Dcic]\}}||«Œ}}}||fScc}}w)Nc3ó.K|] }|«Œy­wrG)r)r*s €r?zMrrulewrapper._aware_return_wrapper.<locals>.normalize_args.<locals>.<genexpr>søèø€Ò s×<ùsƒ)Útupler)ÚargsrÚkwr)r*s €r?Únormalize_argsz:rrulewrapper._aware_return_wrapper.<locals>.normalize_argssJø€ÜÓ<°tÔ<ˆDØ<B¿L¹L»N×°°Sb™-¨ÓKˆFј ùóLs©Acód||«\}}|i|¤Ž}j|j«S©r&r )r.rr[Úfr0s €€€r?Ú
inner_funcz6rrulewrapper._aware_return_wrapper.<locals>.inner_func s9ø€Ù-¨d°FÓ; ˜Ð' Ñ'Ø×*¨2¨t¯|©|Ó<rAcóŠ||«\}}|i|¤Ž}|Dcgc]}j|j«Œ c}Scc}wr2)r.rÚdtsr[r3r0s €€€r?r4z6rrulewrapper._aware_return_wrapper.<locals>.inner_funcsGø€Ù-¨d°FÓ;‘ ˜Ð( Ñ(ØHKÖLÀ"˜×+¨B°· ± ÕLùÒLsš#A)r Ú functoolsÚwraps)r3Ú returns_listr4r*r0s`` @@r?Ú_aware_return_wrapperz"rrulewrapper._aware_return_wrapperïsFû€ð <‰<Р؈ ô ñ÷

Mð
"Œy˜! -rAcóÄ||jvr|j|St|j|«}|dvr|j|«S|dvr|j|d¬«S|S)N>ÚafterÚbefore>ÚxafterÚbetweenÚxbeforeT)r9)Ú__dict__r†r!r:)Únamer3s r?Ú __getattr__zrrulewrapper.__getattr__skØ 4—= Ø—== Ñ D—KK Ó &ˆà Ð ×-¨aÓ
Ð
×-¨a¸ ˆHrAcó:|jj|«y)rAr)Ústates r?Ú __setstate__zrrulewrapper.__setstate__"sØ
×ј#rA)F) r¿rrr&r:rCrFrGrAr?r/r/­s+ñó%ò" /ò>$.òL ó$rAr/cóHeZdZdZddddœZd dZdZdZdZd „Z d
Z
d Z y)
r!z˜
Determines the tick locations when plotting dates.
This class is subclassed by other Locators and
is not meant to be used on its own.
r)ÚbyhourÚbyminuteÚbysecondNcó$t|«|_y)
Parameters
----------
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
Nr¹s r?zDateLocator.__init__/sô˜b“/ˆrAcó$t|«|_y)
Set timezone info.
Parameters
----------
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
Nr¹s r?zDateLocator.set_tzinfo8sô˜b“/ˆrAcó¦|jj«\}}||kDr||}}t||j«t||j«fS)z/Convert axis data interval to datetime objects.)Úget_data_intervalrr9©ÚdminÚdmaxs r?Ú
datalim_to_dtzDateLocator.datalim_to_dtCsIà—YY×2‰
ˆˆdØ $Š;ؘt$ˆ˜˜dŸg™gÓ°°t·w±wÓ(?Ð?rAcó¦|jj«\}}||kDr||}}t||j«t||j«fS)z.Convert the view interval to datetime objects.)Úget_view_intervalrr9©ÚvminÚvmaxs r?Ú
viewlim_to_dtzDateLocator.viewlim_to_dtKsIà—YY×2‰
ˆˆdØ $Š;ؘt$ˆ˜˜dŸg™gÓ°°t·w±wÓ(?Ð?rAcóy)zj
Return how many days a unit of the locator is; used for
intelligent autoscaling.
rCrGs r?r zDateLocator._get_unitRsð
rAcóy)z;
Return the number of units for each tick.
rCrGs r?Ú
_get_intervalzDateLocator._get_intervalYsðrAcó~tj|«rtj|«s@ttjddd««ttjddd««fS||kr||}}|j «}|j
«}t||z
«dkr|d|z|zz}|d|z|zz
}||fS)z
Given the proposed upper and lower extent, adjust the range
if it is too close to being singular (i.e. a range of ~0).
rBrCr×gíµ ÷ư>)rQÚisfiniterr<Údater r[rn)rVrWÚunitÚintervals r?Ú nonsingularzDateLocator.nonsingular_ô
{‰{˜4Ô ¬¯ © °DÔ(9äœXŸ]™]¨4°°AÓœXŸ]™]¨4°°AÓ
$Š;ؘt$ˆDØ~‰~ÓˆØ×'ˆÜ ˆtd‰{Ó ˜ A˜H˜ 'ˆ A˜H˜ 'ˆTˆrA) r¿Úhms0dr±rRrXr r[rarGrAr?r!r!&s:ñð  a°QÑ 7€Eó @ò@òòó rAr!cóNeZdZdˆfd„ ZdZdZdZdZed«Z dZ
ˆxZ S) r"có2t||«||_y)Úsuperr±Úrule)Úor9Ú __class__s €r?zRRuleLocator.__init__usø€Ü
Ñ˜ÔØˆ rAcóp |j«\}}|j||«S#t$rgcYSwxYw©rXr;Ú tick_valuesrOs r?zRRuleLocator.__call__yóDð Ø×-‰JˆD×Ñ  dÓ+øôò ØŠIð úó '§ 5´5cóÐ|j||«\}}|jj||d«}t|«dk(r
t ||g«S|j t |««S)NTr)Ú
_create_rrulerfr?rÚraise_if_exceeds)rVrWÚstartÚstopÚdatess r?rkzRRuleLocator.tick_valuess_Ø×¨tÓ4‰ ˆˆtØ— ‘ ×! %¨¨tÓÜ ˆu‹:˜Š?ܘT 4˜LÓ ×$¤X¨e£_Ó5rAc
ó˜t||«} ||z
} ||z}|j j||¬ «||fS#ttf$r7tjddddddtjj
¬«}YŒlwxYw#ttf$r7tjddddddtjj
¬«}YŒ¯wxYw)
NrCrraé'é ééé;©rr)rr;Ú
OverflowErrorr<r1Úutcrfr)rVrWr˜rqrrs r?rozRRuleLocator._create_rrule‰ô˜d DÓð Dؘ5Lˆ  Cؘ%<ˆ
˜e¨4ˆ
ÔTˆzÐøôœMÐ Dä×% ¨A¨q°!°QÜ-5×->Ñ->×-BÑ-BôDŠEð DûôœMÐ Cä×$ T¨2¨r°2°r¸2Ü,4×,=Ñ,=×,AÑ,AôCŠDð Cús"Ž:BºABÁ?BÂAC ÃC cód|jjj}|j|«S)rfr!Ú_freqÚget_unit_generic)rs r?r zRRuleLocator._get_unit¡s(ày‰y×Ñר×$ *rAcóÞ|tk(rtS|tk(rtS|tk(rt
S|t k(ry|tk(r dtz S|tk(r dtz S|tk(r dtz Sy)ð?rÅ)
r rr rr
Ú
DAYS_PER_WEEKrrrrrrrT)rs r?rzRRuleLocator.get_unit_generic¦spà ”6Š>Ü Ð Ø
”WŠ_Ü
”VŠ^Ü Ð Ø
”UŠ]ØØ
”VŠ^ØœÑ
”XÒ
ØœÑ
”XÒ
ØœÑ rAcóB|jjjS)rfr!Ú _intervalrøs r?r[zRRuleLocator._get_intervalºsØy‰y×Ñ×)rA) rkror Ú staticmethodrr[Ú
__classcell__©rhs@r?r"r"rs5ø„õòò0
ñóðö&*rAr"cóFeZdZdZ dˆfd„ ZdZdZdZdZdZ ˆxZ
S) r#a­
On autoscale, this class picks the best `DateLocator` to set the view
limits and the tick locations.
Attributes
----------
intervald : dict
Mapping of tick frequencies to multiples allowed for that ticking.
The default is ::
self.intervald = {
YEARLY : [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
1000, 2000, 4000, 5000, 10000],
MONTHLY : [1, 2, 3, 4, 6],
DAILY : [1, 2, 3, 7, 14, 21],
HOURLY : [1, 2, 3, 4, 6, 12],
MINUTELY: [1, 5, 10, 15, 30],
SECONDLY: [1, 5, 10, 15, 30],
MICROSECONDLY: [1, 2, 5, 10, 20, 50, 100, 200, 500,
1000, 2000, 5000, 10000, 20000, 50000,
100000, 200000, 500000, 1000000],
}
where the keys are defined in `dateutil.rrule`.
The interval is used to specify multiples that are appropriate for
the frequency of ticking. For instance, every 7 days is sensible
for daily ticks, but for minutes/seconds, 15 or 30 make sense.
When customizing, you should only modify the values for the existing
keys. You should not add or delete entries.
Example for forcing ticks every 3 hours::
locator = AutoDateLocator()
locator.intervald[HOURLY] = [3] # only show every 3 hours
cóÞt||¬«t|_ttt
t tttg|_
||_ tdtdt
dt dtdtdtdi|_ | |jj|«||_tgd¢tgd¢t
gd¢t gd ¢tgd
¢tgd
¢tgd ¢i|_|rgd ¢|j$t
<dt'd
d«t'd
d«t'dd«t'dd«t'dd«dg|_y#t$r(tj!|j|«|_ YŒÎwxYw)a­
Parameters
----------
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
minticks : int
The minimum number of ticks desired; controls whether ticks occur
yearly, monthly, etc.
maxticks : int
The maximum number of ticks desired; controls the interval between
ticks (ticking every other, every 3, etc.). For fine-grained
control, this can be a dictionary mapping individual rrule
frequency constants (YEARLY, MONTHLY, etc.) to their own maximum
number of ticks. This can be used to keep the number of ticks
appropriate to the format chosen in `AutoDateFormatter`. Any
frequency not specified in this dictionary is given a default
value.
interval_multiples : bool, default: True
Whether ticks should be chosen to be multiple of the interval,
locking them to 'nicer' locations. For example, this will force
the ticks to be at hours 0, 6, 12, 18 when hourly ticking is done
at 6 hour intervals.
é rvéN)rCr×éé
rcé(é2édéÈiéôéèéÐéˆé')rCr×)rCééé)rCr×rv)rCréé)rCr×rrcrrrrr“r”r•ri NiPÃi †i@
i ¡rd)rCr×r—r˜rCé
é réé<)rer r~r rrrrr,Ú_freqsÚminticksÚmaxticksrr>ÚdictÚfromkeysÚinterval_multiplesÚ intervaldráÚ _byranges)r9rhs €r?zAutoDateLocator.__init__æs:ø€ô2 јBÐÔ܈Œ
Üœw¬¬v´xܤðŒ à ˆŒ
ä ¤W¨b´%¸¼VÀRÜ! 2¤x°´]ÀAðGˆŒ
à Ð ð
EØ
×$ XÔ #5ˆÔä ò ’oÜ Ò Ò Ò Ò ò ˆŒñ ò%5ˆDN‰Nœ5Ñ ¤ a¨£ ¬e°A°r«lÜ  2›,¬¨a°« ´e¸A¸r³lÀDðJˆøô1ò
Eô!%§
¡
¨d¯k©k¸8Ó D
ð 
EúsÂD;Ä;.E,Å+E,cóZ|j«\}}|j||«}|«S)rXÚ get_locator)rPrQs r?zAutoDateLocator.__call__%s.à×)‰
ˆˆ×" Ó.ˆÙrAcóF|j||«j||«S)rkrUs r?rkzAutoDateLocator.tick_values+s"Ø×Ñ  dÓ7¸¸CrAcó*tj|«rtj|«s@ttjddd««ttjddd««fS||kr||}}||k(r|t
dzz
}|t
dzz}||fS)NrBrCr×)rQr]rr<r^rrUs r?razAutoDateLocator.nonsingular.ô{‰{˜4Ô ¬¯ © °DÔ(9äœXŸ]™]¨4°°AÓœXŸ]™]¨4°°AÓ
$Š;ؘt$ˆ 4Š<Øœ-¨!Ñ+ˆœ-¨!Ñ+ˆTˆrAcóx|jtfvr dtz Stj |j«S©Nr)r~r,rjr"rs r?r zAutoDateLocator._get_unit<s1Ø :‰:œ-˜Ñ Ô ×·±Ó <rAc óœt||«}||z
}||kDr| }| }t|j«}|tz|jz}|j
}|t z|jz}|tz|jz} tj|j««}
tj|j«dz«} ||||| |
| g} dgdzdgz}
gd¢}tt|j| ««D\}\}}||j krd||<Œ|j"|D]}|||j$|dz
zksŒn/|j&r |t(k(st+j,dd «||_|j0|rN|j&rB|j0|dd||<|t(t2fvr|d
k(rdd g||<n |d k(rgd
¢||<d}n|j0|||<nd}t4k(r$|j&rt7|j8¬«}n|
r@|\}}}}}}}t;|j.|||||||¬« }t=||j8¬«}nKt?|j8¬«}tA|«dkDr&|dkr!t+j,dtC«d«|jE|jF«|S)z*Pick the best locator based on a distance.rDTrÃF)NrCrCrrrNNrCzºAutoDateLocator was unable to pick an appropriate interval for this date range. It may be necessary to add an interval value to the AutoDateLocator's intervald dictionary. Defaulting to r3r˜r—)rCré)r`rrÚbymonthÚ
bymonthdayrHrIrJrbr“zOPlotting microsecond time intervals for dates far from the epoch (time origin: zL) is not well-supported. See matplotlib.dates.set_epoch to change the epoch.)$rr ÚyearsÚMONTHS_PER_YEARÚmonthsrrÚhoursÚ MIN_PER_HOURÚminutesrQÚfloorr“Ú enumerateÚzipr rrÚ
warn_externalr~r
r r$r9r/r"r+rrÚset_axisræ)rPrQr˜ÚtdeltaÚnumYearsÚ numMonthsÚnumDaysÚnumHoursÚ
numMinutesÚ
numSecondsÚnumMicrosecondsÚnumsÚuse_rrule_locatorÚbyrangesÚirr`Ú_r°rHrIrJrs r?zAutoDateLocator.get_locatorBä˜d DÓØ˜ˆð $Š;ØFˆEØWˆ
˜ŸÓ؜ѷ±Ñ=ˆ Ø—+‘+ˆØœ]Ñ*¨U¯[©[ÑØ¤ Ñ,¨u¯}©}Ñ<ˆ
Ü—X‘X˜f×
ÜŸ(™( 6×#7Ñ#7Ó#9¸CÑ#?Ó@ˆà˜) W¨h¸
ؘ-ˆð"˜F Q™J¨%¨Ñò
ô¨D¯K©K¸Ó(>Ó' ‰NˆA‰{T—]#˜ Øð!ŸN™N¨4Ñ
Lؘ( d§m¡m°DÑ&9¸AÑ&=Ñð
Lð×/°D¼E²MÜ×@H¸ðKôLðˆDŒJà~‰~˜  T×%<Ò%<Ø"Ÿn™n¨QÑ
°(°
Ñ;˜ Øœ¤˜Ñ 2~à'(¨" g˜ š Ø! Ú&4˜  àà"Ÿn™n¨QÑ/˜ Ù ðK' ðNˆ ”FŠN × 7Ò 7Ü! (¨t¯w©wÔ7‰GØ
˜
!ØDLÑ AˆAˆw˜
 F¨H°hÀÜ  §¡°hØ)-°TØ)0¸ZØ(.¸Ø*2ô 4ˆ # 5¨T¯W©WÔ5‰Gä°d·g±gÔ>ˆGܘ‹~ Ò(¨X¸ª_Ü×/Ü/8«{¨mð<ðôð ×јŸÔˆrA)NrÖNT) r¿rkrar r†r‡s@r?r#r#¾s3ø„ñ%ðN6:Ø$(õ=Jò~ò Dò ò brAr#có*eZdZdZdˆfd„ ZdZˆxZS)r$
Make ticks on a given day of each year that is a multiple of base.
Examples::
# Tick every year on Jan 1st
locator = YearLocator()
# Tick every 5 years on July 4th
locator = YearLocator(5, month=7, day=4)
cóšttf|||dœ|j¤Ž}t|||¬«t j |d«|_y)
Parameters
----------
base : int, default: 1
Mark ticks every *base* years.
month : int, default: 1
The month on which to place the ticks, starting from 1. Default is
January.
day : int, default: 1
The day on which to place the ticks.
tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
)r`rN)r/r rbrerÚ
_Edge_integerÚbase)ÚmonthÚdayr9rfrhs €r?zYearLocator.__init__³sOø€ôœFð:¨T¸5Ø'*ñ:Ø.2¯j©jñ:ˆä
ј "ÐÔרqÓ1ˆ rAcó"t|jj|j«|jjzd«}t |jj
|j«|jjzd«}|jj}||jdd«|jdd«ddddœ}|jd i|¤Ž}|j|¬«}|jj||¬«||fS)
NrCrur)ÚyearrÎÚhourÚminuterä)rzrG) ÚmaxrÍÚlerÑrÚgerfrÚgetrlr) r°rVrWÚyminÚymaxÚcrlrqrrs r?rozYearLocator._create_rruleÆs×ô4—99—<< § ¡ Ó*¨T¯Y©Y¯^©^Ñ;¸?ˆÜ4—99—<< § ¡ Ó*¨T¯Y©Y¯^©^Ñ;¸TÓà I‰I× Ñ ˆØØŸE™E )¨QÓŸ%™%  ¨aÓ¨°Qñð
 Ñ'˜'ˆØ}‰} $ˆ'ˆØ