<areashape="rect" id="node13" href="#matplotlib.dates.MonthLocator" title="Make ticks on occurances of each month month, eg 1, 3, 12." alt="" coords="660,4,755,26"/>
<areashape="rect" id="node23" href="#matplotlib.dates.MinuteLocator" title="Make ticks on occurances of each minute." alt="" coords="658,47,757,69"/>
<areashape="rect" id="node25" href="#matplotlib.dates.HourLocator" title="Make ticks on occurances of each hour." alt="" coords="663,90,752,112"/>
<areashape="rect" id="node29" href="#matplotlib.dates.SecondLocator" title="Make ticks on occurances of each second." alt="" coords="656,133,759,155"/>
<areashape="rect" id="node33" href="#matplotlib.dates.DayLocator" title="Make ticks on occurances of each day of the month.  For example," alt="" coords="666,176,749,198"/>
<areashape="rect" id="node35" href="#matplotlib.dates.WeekdayLocator" title="Make ticks on occurances of each weekday." alt="" coords="652,219,763,241"/>
<areashape="rect" id="node7" href="#matplotlib.dates.AutoDateLocator" title="On autoscale, this class picks the best" alt="" coords="496,155,610,177"/>
<areashape="rect" id="node21" href="#matplotlib.dates.YearLocator" title="Make ticks on a given day of each year that is a multiple of base." alt="" coords="511,198,595,221"/>
<areashape="rect" id="node4" href="#matplotlib.dates.AutoDateFormatter" title="This class attempts to figure out the best format to use.  This is" alt="" coords="323,26,451,48"/>
<areashape="rect" id="node5" href="ticker_api.html#matplotlib.ticker.Formatter" title="Convert the tick location to a string" alt="" coords="191,91,265,113"/>
<areashape="rect" id="node15" href="#matplotlib.dates.IndexDateFormatter" title="Use with :class:`~matplotlib.ticker.IndexLocator` to cycle format" alt="" coords="322,69,453,91"/>
<areashape="rect" id="node31" href="#matplotlib.dates.DateFormatter" title="Tick location is seconds since the epoch.  Use a :func:`strftime`" alt="" coords="337,112,438,134"/>
<areashape="rect" id="node9" href="ticker_api.html#matplotlib.ticker.Locator" title="Determine the tick locations;" alt="" coords="197,134,259,157"/>
<areashape="rect" id="node17" href="units_api.html#matplotlib.units.ConversionInterface" title="The minimal interface for a converter to take custom instances (or" alt="" coords="5,48,135,70"/>
<areashape="rect" id="node19" title="Converter for datetime.date and datetime.datetime data," alt="" coords="177,48,279,70"/>
<areashape="rect" id="node28" title="Use this class to parse date strings to matplotlib datenums when" alt="" coords="20,5,119,27"/>
</map>
</p>
<divclass="section" id="module-matplotlib.dates">
<spanid="matplotlib-dates"></span><h2><aclass="reference internal" href="#module-matplotlib.dates" title="matplotlib.dates"><ttclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.dates</span></tt></a><aclass="headerlink" href="#module-matplotlib.dates" title="Permalink to this headline">¶</a></h2>
<p>Matplotlib provides sophisticated date plotting capabilities, standing on the
shoulders of python <ttclass="xref py py-mod docutils literal"><spanclass="pre">datetime</span></tt>, the add-on modules <ttclass="xref py py-mod docutils literal"><spanclass="pre">pytz</span></tt> and
<ttclass="xref py py-mod docutils literal"><spanclass="pre">dateutils</span></tt>. <ttclass="xref py py-class docutils literal"><spanclass="pre">datetime</span></tt> objects are converted to floating point
numbers which represent time in days since 0001-01-01 UTC, plus 1. For
example, 0001-01-01, 06:00 is 1.25, not 0.25. The helper functions
<aclass="reference internal" href="#matplotlib.dates.date2num" title="matplotlib.dates.date2num"><ttclass="xref py py-func docutils literal"><spanclass="pre">date2num()</span></tt></a>, <aclass="reference internal" href="#matplotlib.dates.num2date" title="matplotlib.dates.num2date"><ttclass="xref py py-func docutils literal"><spanclass="pre">num2date()</span></tt></a> and <aclass="reference internal" href="#matplotlib.dates.drange" title="matplotlib.dates.drange"><ttclass="xref py py-func docutils literal"><spanclass="pre">drange()</span></tt></a> are used to facilitate
easy conversion to and from <ttclass="xref py py-mod docutils literal"><spanclass="pre">datetime</span></tt> and numeric ranges.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>Like Python’s datetime, mpl 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 mpl give as the number of days since 0001-01-01 and what other
software and databases yield. For example, the <aclass="reference external" href="http://www.usno.navy.mil/USNO/astronomical-applications/data-services/jul-date">US Naval Observatory</a>
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
<p>A wide range of specific and general purpose date tick locators and
formatters are provided in this module. See
<aclass="reference internal" href="ticker_api.html#module-matplotlib.ticker" title="matplotlib.ticker"><ttclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.ticker</span></tt></a> for general information on tick locators
and formatters. These are described below.</p>
<p>All the matplotlib date converters, tickers and formatters are
timezone aware, and the default timezone is given by the timezone
parameter in your <ttclass="file docutils literal"><spanclass="pre">matplotlibrc</span></tt> file. If you leave out a
<ttclass="xref py py-class docutils literal"><spanclass="pre">tz</span></tt> timezone instance, the default from your rc file will be
assumed. If you want to use a custom time zone, pass a
<ttclass="xref py py-class docutils literal"><spanclass="pre">pytz.timezone</span></tt> instance with the tz keyword argument to
<aclass="reference internal" href="#matplotlib.dates.num2date" title="matplotlib.dates.num2date"><ttclass="xref py py-func docutils literal"><spanclass="pre">num2date()</span></tt></a>, <ttclass="xref py py-func docutils literal"><spanclass="pre">plot_date()</span></tt>, and any custom date tickers or
locators you create. See <aclass="reference external" href="http://pytz.sourceforge.net">pytz</a> for
information on <ttclass="xref py py-mod docutils literal"><spanclass="pre">pytz</span></tt> and timezone handling.</p>
<li><aclass="reference internal" href="#matplotlib.dates.DayLocator" title="matplotlib.dates.DayLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">DayLocator</span></tt></a>: locate specifed days of the month</li>
<li><aclass="reference internal" href="#matplotlib.dates.WeekdayLocator" title="matplotlib.dates.WeekdayLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">WeekdayLocator</span></tt></a>: Locate days of the week, eg MO, TU</li>
<li><aclass="reference internal" href="#matplotlib.dates.YearLocator" title="matplotlib.dates.YearLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">YearLocator</span></tt></a>: locate years that are multiples of base</li>
<li><aclass="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">RRuleLocator</span></tt></a>: locate using a
<ttclass="xref py py-class docutils literal"><spanclass="pre">matplotlib.dates.rrulewrapper</span></tt>. The
<ttclass="xref py py-class docutils literal"><spanclass="pre">rrulewrapper</span></tt> is a simple wrapper around a
<ttclass="xref py py-class docutils literal"><spanclass="pre">dateutil.rrule</span></tt> (<aclass="reference external" href="http://labix.org/python-dateutil">dateutil</a>) which allow almost
arbitrary date tick specifications. See <aclass="reference external" href="../examples/pylab_examples/date_demo_rrule.html">rrule example</a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">AutoDateLocator</span></tt></a>: On autoscale, this class picks the best
<ttclass="xref py py-class docutils literal"><spanclass="pre">MultipleDateLocator</span></tt> to set the view limits and the tick
locations.</li>
</ul>
</div></blockquote>
</div>
<divclass="section" id="date-formatters">
<h3>Date formatters<aclass="headerlink" href="#date-formatters" title="Permalink to this headline">¶</a></h3>
<p>Here all all the date formatters:</p>
<blockquote>
<div><ulclass="simple">
<li><aclass="reference internal" href="#matplotlib.dates.AutoDateFormatter" title="matplotlib.dates.AutoDateFormatter"><ttclass="xref py py-class docutils literal"><spanclass="pre">AutoDateFormatter</span></tt></a>: attempts to figure out the best format
to use. This is most useful when used with the <aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">AutoDateLocator</span></tt></a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.DateFormatter" title="matplotlib.dates.DateFormatter"><ttclass="xref py py-class docutils literal"><spanclass="pre">DateFormatter</span></tt></a>: use <ttclass="xref py py-func docutils literal"><spanclass="pre">strftime()</span></tt> format strings</li>
<li><aclass="reference internal" href="#matplotlib.dates.IndexDateFormatter" title="matplotlib.dates.IndexDateFormatter"><ttclass="xref py py-class docutils literal"><spanclass="pre">IndexDateFormatter</span></tt></a>: date plots with implicit <em>x</em>
indexing.</li>
</ul>
</div></blockquote>
<dlclass="function">
<dtid="matplotlib.dates.date2num">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">date2num</tt><big>(</big><em>d</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.date2num" title="Permalink to this definition">¶</a></dt>
<dd><p><em>d</em> is either a <ttclass="xref py py-class docutils literal"><spanclass="pre">datetime</span></tt> instance or a sequence of datetimes.</p>
<p>Return value is a floating point number (or sequence of floats)
which gives the number of days (fraction part represents hours,
minutes, seconds) since 0001-01-01 00:00:00 UTC, <em>plus</em><em>one</em>.
The addition of one here is a historical artifact. Also, note
that the Gregorian calendar is assumed; this is not universal
practice. For details, see the module docstring.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.num2date">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">num2date</tt><big>(</big><em>x</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.num2date" title="Permalink to this definition">¶</a></dt>
<dd><p><em>x</em> is a float value which gives the number of days
(fraction part represents hours, minutes, seconds) since
0001-01-01 00:00:00 UTC <em>plus</em><em>one</em>.
The addition of one here is a historical artifact. Also, note
that the Gregorian calendar is assumed; this is not universal
practice. For details, see the module docstring.</p>
<p>Return value is a <ttclass="xref py py-class docutils literal"><spanclass="pre">datetime</span></tt> instance in timezone <em>tz</em> (default to
rcparams TZ value).</p>
<p>If <em>x</em> is a sequence, a sequence of <ttclass="xref py py-class docutils literal"><spanclass="pre">datetime</span></tt> objects will
be returned.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.drange">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">drange</tt><big>(</big><em>dstart</em>, <em>dend</em>, <em>delta</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.drange" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a date range as float Gregorian ordinals. <em>dstart</em> and
<em>dend</em> are <ttclass="xref py py-class docutils literal"><spanclass="pre">datetime</span></tt> instances. <em>delta</em> is a
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">epoch2num</tt><big>(</big><em>e</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.epoch2num" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an epoch or sequence of epochs to the new date format,
that is days since 0001.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.num2epoch">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">num2epoch</tt><big>(</big><em>d</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.num2epoch" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert days since 0001 to epoch. <em>d</em> can be a number or sequence.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.mx2num">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">mx2num</tt><big>(</big><em>mxdates</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.mx2num" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">DateFormatter</tt><big>(</big><em>fmt</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateFormatter" title="Permalink to this definition">¶</a></dt>
<p>Tick location is seconds since the epoch. Use a <aclass="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><ttclass="xref py py-func docutils literal"><spanclass="pre">strftime()</span></tt></a>
for years greater than 1900. Thanks to Andrew Dalke, Dalke
Scientific Software who contributed the <aclass="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><ttclass="xref py py-func docutils literal"><spanclass="pre">strftime()</span></tt></a> code
below to include dates earlier than this year.</p>
<dlclass="docutils">
<dt><em>fmt</em> is an <aclass="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><ttclass="xref py py-func docutils literal"><spanclass="pre">strftime()</span></tt></a> format string; <em>tz</em> is the</dt>
<ttclass="descname">illegal_s</tt><emclass="property"> = <_sre.SRE_Pattern object at 0x2e0e3e0></em><aclass="headerlink" href="#matplotlib.dates.DateFormatter.illegal_s" title="Permalink to this definition">¶</a></dt>
<ttclass="descname">set_tzinfo</tt><big>(</big><em>tz</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateFormatter.set_tzinfo" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.DateFormatter.strftime">
<ttclass="descname">strftime</tt><big>(</big><em>dt</em>, <em>fmt</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateFormatter.strftime" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.IndexDateFormatter">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">IndexDateFormatter</tt><big>(</big><em>t</em>, <em>fmt</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.IndexDateFormatter" title="Permalink to this definition">¶</a></dt>
<p>Use with <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.IndexLocator" title="matplotlib.ticker.IndexLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">IndexLocator</span></tt></a> to cycle format
strings by index.</p>
<p><em>t</em> is a sequence of dates (floating point days). <em>fmt</em> is a
<ttclass="xref py py-func docutils literal"><spanclass="pre">strftime()</span></tt> format string.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.AutoDateFormatter">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">AutoDateFormatter</tt><big>(</big><em>locator</em>, <em>tz=None</em>, <em>defaultfmt='%Y-%m-%d'</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.AutoDateFormatter" title="Permalink to this definition">¶</a></dt>
<p>This class attempts to figure out the best format to use. This is
most useful when used with the <aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><ttclass="xref py py-class docutils literal"><spanclass="pre">AutoDateLocator</span></tt></a>.</p>
<p>The AutoDateFormatter has a scale dictionary that maps the scale
of the tick (the distance in days between one major tick) and a
<spanclass="n">formatter</span><spanclass="o">.</span><spanclass="n">scaled</span><spanclass="p">[</span><spanclass="mi">1</span><spanclass="o">/</span><spanclass="p">(</span><spanclass="mf">24.</span><spanclass="o">*</span><spanclass="mf">60.</span><spanclass="p">)]</span><spanclass="o">=</span><spanclass="s">'%M:%S'</span><spanclass="c"># only show min and sec</span>
</pre></div>
</div>
<p>Autofmt the date labels. The default format is the one to use
if none of the times in scaled match</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.DateLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">DateLocator</tt><big>(</big><em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateLocator" title="Permalink to this definition">¶</a></dt>
<ttclass="descname">datalim_to_dt</tt><big>(</big><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateLocator.datalim_to_dt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dates.DateLocator.hms0d">
<ttclass="descname">hms0d</tt><emclass="property"> = {'byminute': 0, 'byhour': 0, 'bysecond': 0}</em><aclass="headerlink" href="#matplotlib.dates.DateLocator.hms0d" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.DateLocator.nonsingular">
<ttclass="descname">nonsingular</tt><big>(</big><em>vmin</em>, <em>vmax</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateLocator.nonsingular" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.DateLocator.set_tzinfo">
<ttclass="descname">set_tzinfo</tt><big>(</big><em>tz</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateLocator.set_tzinfo" title="Permalink to this definition">¶</a></dt>
<ttclass="descname">viewlim_to_dt</tt><big>(</big><big>)</big><aclass="headerlink" href="#matplotlib.dates.DateLocator.viewlim_to_dt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.RRuleLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">RRuleLocator</tt><big>(</big><em>o</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.RRuleLocator" title="Permalink to this definition">¶</a></dt>
<ttclass="descname">autoscale</tt><big>(</big><big>)</big><aclass="headerlink" href="#matplotlib.dates.RRuleLocator.autoscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the view limits to include the data range.</p>
<emclass="property">static </em><ttclass="descname">get_unit_generic</tt><big>(</big><em>freq</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.RRuleLocator.get_unit_generic" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.AutoDateLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">AutoDateLocator</tt><big>(</big><em>tz=None</em>, <em>minticks=5</em>, <em>maxticks=None</em>, <em>interval_multiples=False</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator" title="Permalink to this definition">¶</a></dt>
<ttclass="xref py py-class docutils literal"><spanclass="pre">MultipleDateLocator</span></tt> to set the view limits and the tick
locations.</p>
<p><em>minticks</em> is the minimum number of ticks desired, which is used to
select the type of ticking (yearly, monthly, etc.).</p>
<p><em>maxticks</em> is the maximum number of ticks desired, which controls
any interval between ticks (ticking every other, every 3, etc.).
For really 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
class:<aclass="reference internal" href="#matplotlib.dates.AutoDateFormatter" title="matplotlib.dates.AutoDateFormatter"><ttclass="xref py py-obj docutils literal"><spanclass="pre">AutoDateFormatter</span></tt></a>. Any frequency not specified in this
dictionary is given a default value.</p>
<p><em>tz</em> is a <ttclass="xref py py-class docutils literal"><spanclass="pre">tzinfo</span></tt> instance.</p>
<p><em>interval_multiples</em> is a boolean that indicates whether ticks
should be chosen to be multiple of the interval. This will lock
ticks 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.</p>
<p>The AutoDateLocator has an interval dictionary that maps the
frequency of the tick (a constant from dateutil.rrule) and a
multiple allowed for that ticking. The default looks like this:</p>
<spanclass="n">locator</span><spanclass="o">.</span><spanclass="n">intervald</span><spanclass="p">[</span><spanclass="n">HOURLY</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="p">[</span><spanclass="mi">3</span><spanclass="p">]</span><spanclass="c"># only show every 3 hours</span>
<ttclass="descname">autoscale</tt><big>(</big><big>)</big><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.autoscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to choose the view limits intelligently.</p>
<ttclass="descname">get_locator</tt><big>(</big><em>dmin</em>, <em>dmax</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.get_locator" title="Permalink to this definition">¶</a></dt>
<dd><p>Pick the best locator based on a distance.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.AutoDateLocator.refresh">
<ttclass="descname">refresh</tt><big>(</big><big>)</big><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.refresh" title="Permalink to this definition">¶</a></dt>
<dd><p>Refresh internal information based on current limits.</p>
<ttclass="descname">set_axis</tt><big>(</big><em>axis</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.set_axis" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.YearLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">YearLocator</tt><big>(</big><em>base=1</em>, <em>month=1</em>, <em>day=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.YearLocator" title="Permalink to this definition">¶</a></dt>
<p>Mark years that are multiple of base on a given month and day
(default jan 1).</p>
<dlclass="method">
<dtid="matplotlib.dates.YearLocator.autoscale">
<ttclass="descname">autoscale</tt><big>(</big><big>)</big><aclass="headerlink" href="#matplotlib.dates.YearLocator.autoscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the view limits to include the data range.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.MonthLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">MonthLocator</tt><big>(</big><em>bymonth=None</em>, <em>bymonthday=1</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.MonthLocator" title="Permalink to this definition">¶</a></dt>
<p>Make ticks on occurances of each month month, eg 1, 3, 12.</p>
<p>Mark every month in <em>bymonth</em>; <em>bymonth</em> can be an int or
sequence. Default is <ttclass="docutils literal"><spanclass="pre">range(1,13)</span></tt>, i.e. every month.</p>
<p><em>interval</em> is the interval between each iteration. For
example, if <ttclass="docutils literal"><spanclass="pre">interval=2</span></tt>, mark every second occurance.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.WeekdayLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">WeekdayLocator</tt><big>(</big><em>byweekday=1</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.WeekdayLocator" title="Permalink to this definition">¶</a></dt>
<p>Mark every weekday in <em>byweekday</em>; <em>byweekday</em> can be a number or
sequence.</p>
<p>Elements of <em>byweekday</em> must be one of MO, TU, WE, TH, FR, SA,
SU, the constants from <ttclass="xref py py-mod docutils literal"><spanclass="pre">dateutils.rrule</span></tt>.</p>
<p><em>interval</em> specifies the number of weeks to skip. For example,
<ttclass="docutils literal"><spanclass="pre">interval=2</span></tt> plots every second week.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.DayLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">DayLocator</tt><big>(</big><em>bymonthday=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.DayLocator" title="Permalink to this definition">¶</a></dt>
<p>Make ticks on occurances of each day of the month. For example,
1, 15, 30.</p>
<p>Mark every day in <em>bymonthday</em>; <em>bymonthday</em> can be an int or
sequence.</p>
<p>Default is to tick every day of the month: <ttclass="docutils literal"><spanclass="pre">bymonthday=range(1,32)</span></tt></p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.HourLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">HourLocator</tt><big>(</big><em>byhour=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.HourLocator" title="Permalink to this definition">¶</a></dt>
<p>Mark every hour in <em>byhour</em>; <em>byhour</em> can be an int or sequence.
Default is to tick every hour: <ttclass="docutils literal"><spanclass="pre">byhour=range(24)</span></tt></p>
<p><em>interval</em> is the interval between each iteration. For
example, if <ttclass="docutils literal"><spanclass="pre">interval=2</span></tt>, mark every second occurrence.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.MinuteLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">MinuteLocator</tt><big>(</big><em>byminute=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.MinuteLocator" title="Permalink to this definition">¶</a></dt>
<p>Mark every minute in <em>byminute</em>; <em>byminute</em> can be an int or
sequence. Default is to tick every minute: <ttclass="docutils literal"><spanclass="pre">byminute=range(60)</span></tt></p>
<p><em>interval</em> is the interval between each iteration. For
example, if <ttclass="docutils literal"><spanclass="pre">interval=2</span></tt>, mark every second occurrence.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.SecondLocator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">SecondLocator</tt><big>(</big><em>bysecond=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.SecondLocator" title="Permalink to this definition">¶</a></dt>
<p>Mark every second in <em>bysecond</em>; <em>bysecond</em> can be an int or
sequence. Default is to tick every second: <ttclass="docutils literal"><spanclass="pre">bysecond</span><spanclass="pre">=</span><spanclass="pre">range(60)</span></tt></p>
<p><em>interval</em> is the interval between each iteration. For
example, if <ttclass="docutils literal"><spanclass="pre">interval=2</span></tt>, mark every second occurrence.</p>
<dd>One of the weekday instances (MO, TU, etc). These instances may
receive a parameter N, specifying the Nth weekday, which could
be positive or negative (like MO(+1) or MO(-2). Not specifying
it is the same as specifying +1. You can also use an integer,
where 0=MO.</dd>
<dt>leapdays:</dt>
<dd>Will add given days to the date found, if year is a leap
year, and the date found is post 28 of february.</dd>
<dt>yearday, nlyearday:</dt>
<dd>Set the yearday or the non-leap year day (jump leap days).
These are converted to day/month/leapdays information.</dd>
</dl>
</div></blockquote>
<p>Here is the behavior of operations with relativedelta:</p>
<olclass="arabic simple">
<li>Calculate the absolute year, using the ‘year’ argument, or the
original datetime year, if the argument is not present.</li>
<li>Add the relative ‘years’ argument to the absolute year.</li>
<li>Do steps 1 and 2 for month/months.</li>
<li>Calculate the absolute day, using the ‘day’ argument, or the
original datetime day, if the argument is not present. Then,
subtract from the day until it fits in the year and month
found after their operations.</li>
<li>Add the relative ‘days’ argument to the absolute day. Notice
that the ‘weeks’ argument is multiplied by 7 and added to
‘days’.</li>
<li>Do steps 1 and 2 for hour/hours, minute/minutes, second/seconds,
microsecond/microseconds.</li>
<li>If the ‘weekday’ argument is present, calculate the weekday,
with the given (wday, nth) tuple. wday is the index of the
weekday (0-6, 0=Mon), and nth is the number of weeks to add
forward or backward, depending on its signal. Notice that if
the calculated date is already Monday, for example, using
(0, 1) or (0, -1) won’t change the day.</li>
</ol>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.seconds">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">seconds</tt><big>(</big><em>s</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.seconds" title="Permalink to this definition">¶</a></dt>
<dd><p>Return seconds as days.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.minutes">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">minutes</tt><big>(</big><em>m</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.minutes" title="Permalink to this definition">¶</a></dt>
<dd><p>Return minutes as days.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.hours">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">hours</tt><big>(</big><em>h</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.hours" title="Permalink to this definition">¶</a></dt>
<dd><p>Return hours as days.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.weeks">
<ttclass="descclassname">matplotlib.dates.</tt><ttclass="descname">weeks</tt><big>(</big><em>w</em><big>)</big><aclass="headerlink" href="#matplotlib.dates.weeks" title="Permalink to this definition">¶</a></dt>