You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v2.2.3). For the latest version see <ahref="https://matplotlib.org/stable/api/dates_api.html">https://matplotlib.org/stable/api/dates_api.html</a></div>
<areashape="rect" id="node1" href="#matplotlib.dates.AutoDateFormatter" target="_top" title="This class attempts to figure out the best format to use.  This is" alt="" coords="325,65,447,87"/>
<areashape="rect" id="node2" href="ticker_api.html#matplotlib.ticker.Formatter" target="_top" title="Create a string based on a tick value and location." alt="" coords="191,128,263,149"/>
<areashape="rect" id="node7" href="#matplotlib.dates.DateFormatter" target="_top" title="Tick location is seconds since the epoch.  Use a :func:`strftime`" alt="" coords="337,107,434,128"/>
<areashape="rect" id="node13" href="#matplotlib.dates.IndexDateFormatter" target="_top" title="Use with :class:`~matplotlib.ticker.IndexLocator` to cycle format" alt="" coords="322,148,449,169"/>
<areashape="rect" id="node3" href="#matplotlib.dates.AutoDateLocator" target="_top" title="On autoscale, this class picks the best" alt="" coords="498,127,607,148"/>
<areashape="rect" id="node4" href="#matplotlib.dates.DateLocator" target="_top" title="Determines the tick locations when plotting dates." alt="" coords="343,189,428,210"/>
<areashape="rect" id="node14" href="#matplotlib.dates.MicrosecondLocator" target="_top" title="Make ticks on regular intervals of one or more microsecond(s)." alt="" coords="489,209,615,230"/>
<areashape="rect" id="node19" href="#matplotlib.dates.YearLocator" target="_top" title="Make ticks on a given day of each year that is a multiple of base." alt="" coords="512,250,593,271"/>
<areashape="rect" id="node5" href="units_api.html#matplotlib.units.ConversionInterface" target="_top" title="The minimal interface for a converter to take custom data types (or" alt="" coords="4,87,132,108"/>
<areashape="rect" id="node8" href="ticker_api.html#matplotlib.ticker.Locator" target="_top" title="Determine the tick locations;" alt="" coords="197,189,257,210"/>
<areashape="rect" id="node9" href="#matplotlib.dates.DayLocator" target="_top" title="Make ticks on occurrences of each day of the month.  For example," alt="" coords="669,64,749,85"/>
<areashape="rect" id="node12" href="#matplotlib.dates.HourLocator" target="_top" title="Make ticks on occurrences of each hour." alt="" coords="667,105,751,127"/>
<areashape="rect" id="node15" href="#matplotlib.dates.MinuteLocator" target="_top" title="Make ticks on occurrences of each minute." alt="" coords="661,146,757,168"/>
<areashape="rect" id="node16" href="#matplotlib.dates.MonthLocator" target="_top" title="Make ticks on occurrences of each month, e.g., 1, 3, 12." alt="" coords="663,188,755,209"/>
<areashape="rect" id="node17" href="#matplotlib.dates.SecondLocator" target="_top" title="Make ticks on occurrences of each second." alt="" coords="660,229,758,250"/>
<areashape="rect" id="node18" href="#matplotlib.dates.WeekdayLocator" target="_top" title="Make ticks on occurrences of each weekday." alt="" coords="655,270,764,291"/>
<spanid="date-format"></span><h3>Matplotlib date format<aclass="headerlink" href="#matplotlib-date-format" title="Permalink to this headline">¶</a></h3>
<p>Matplotlib represents dates using floating point numbers specifying the number
of days since 0001-01-01 UTC, plus 1. For example, 0001-01-01, 06:00 is 1.25,
not 0.25. Values < 1, i.e. dates before 0001-01-01 UTC are not supported.</p>
<p>There are a number of helper functions to convert between <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#module-datetime" title="(in Python v3.7)"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">datetime</span></code></a>
<td>Convert number of days to a <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.timedelta" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">timedelta</span></code></a> object.</td>
<td>Convert mx <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">datetime</span></code> instance (or sequence of mx instances) to the new date format.</td>
<p>All the Matplotlib date converters, tickers and formatters are timezone aware.
If no explicit timezone is provided, the rcParam <codeclass="docutils literal notranslate"><spanclass="pre">timezone</span></code> is assumend. If
you want to use a custom time zone, pass a <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">pytz.timezone</span></code> instance
with the tz keyword argument to <aclass="reference internal" href="#matplotlib.dates.num2date" title="matplotlib.dates.num2date"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">num2date()</span></code></a>, <aclass="reference internal" href="_as_gen/matplotlib.pyplot.plot_date.html#matplotlib.pyplot.plot_date" title="matplotlib.pyplot.plot_date"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">plot_date()</span></code></a>, and any
custom date tickers or locators you create.
See <aclass="reference external" href="http://pythonhosted.org/pytz/">pytz</a> for information on <codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">pytz</span></code> and
timezone handling.</p>
<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"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.ticker</span></code></a> for general information on tick locators
<li><aclass="reference internal" href="#matplotlib.dates.DayLocator" title="matplotlib.dates.DayLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">DayLocator</span></code></a>: locate specified days of the month</li>
<li><aclass="reference internal" href="#matplotlib.dates.WeekdayLocator" title="matplotlib.dates.WeekdayLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">WeekdayLocator</span></code></a>: Locate days of the week, e.g., MO, TU</li>
<li><aclass="reference internal" href="#matplotlib.dates.YearLocator" title="matplotlib.dates.YearLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">YearLocator</span></code></a>: locate years that are multiples of base</li>
<li><aclass="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">RRuleLocator</span></code></a>: locate using a
<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">matplotlib.dates.rrulewrapper</span></code>. The
<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">rrulewrapper</span></code> is a simple wrapper around a
<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dateutil.rrule</span></code> (<aclass="reference external" href="https://dateutil.readthedocs.io/en/stable/">dateutil</a>) which allow almost
arbitrary date tick specifications. See <aclass="reference external" href="../gallery/ticks_and_spines/date_demo_rrule.html">rrule example</a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></a>: On autoscale, this class picks the best
locations. If called with <codeclass="docutils literal notranslate"><spanclass="pre">interval_multiples=True</span></code> it will
make ticks line up with sensible multiples of the tick intervals. E.g.
if the interval is 4 hours, it will pick hours 0, 4, 8, etc as ticks.
This behaviour is not guaranteed by default.</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"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoDateFormatter</span></code></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"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.DateFormatter" title="matplotlib.dates.DateFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">DateFormatter</span></code></a>: use <codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">strftime()</span></code> format strings</li>
<li><aclass="reference internal" href="#matplotlib.dates.IndexDateFormatter" title="matplotlib.dates.IndexDateFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">IndexDateFormatter</span></code></a>: date plots with implicit <em>x</em>
indexing.</li>
</ul>
</div></blockquote>
<dlclass="function">
<dtid="matplotlib.dates.date2num">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">date2num</code><spanclass="sig-paren">(</span><em>d</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#date2num"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.date2num" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert datetime objects to Matplotlib dates.</p>
<dt><strong>d</strong><spanclass="classifier-delimiter">:</span><spanclass="classifier"><aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime.datetime</span></code></a> or <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">numpy.datetime64</span></code> or sequences of these</span></dt>
<dd></dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>float or sequence of floats</strong></dt>
<dd><pclass="first last">Number of days (fraction part represents hours, minutes, seconds, ms)
since 0001-01-01 00:00:00 UTC, plus one.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p>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">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">num2date</code><spanclass="sig-paren">(</span><em>x</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#num2date"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.num2date" title="Permalink to this definition">¶</a></dt>
<dd><pclass="first last">Timezone of <em>x</em> (defaults to rcparams <codeclass="docutils literal notranslate"><spanclass="pre">timezone</span></code>).</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>`~datetime.datetime` or sequence of `~datetime.datetime`</strong></dt>
<dd><pclass="first">Dates are returned in timezone <em>tz</em>.</p>
<pclass="last">If <em>x</em> is a sequence, a sequence of <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">datetime</span></code> objects will
be returned.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p>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.num2timedelta">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">num2timedelta</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#num2timedelta"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.num2timedelta" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert number of days to a <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.timedelta" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">timedelta</span></code></a> object.</p>
<p>If <em>x</em> is a sequence, a sequence of <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.timedelta" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">timedelta</span></code></a> objects will
<dt><strong>x</strong><spanclass="classifier-delimiter">:</span><spanclass="classifier">float, sequence of floats</span></dt>
<dd><pclass="first last">Number of days. The fraction part represents hours, minutes, seconds.</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>`datetime.timedelta` or list[`datetime.timedelta`]</strong></dt>
<dd></dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.drange">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">drange</code><spanclass="sig-paren">(</span><em>dstart</em>, <em>dend</em>, <em>delta</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#drange"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.drange" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a sequence of equally spaced Matplotlib dates.</p>
<p>The dates start at <em>dstart</em> and reach up to, but not including <em>dend</em>.
<dd><pclass="first last">A list floats representing Matplotlib dates.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.epoch2num">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">epoch2num</code><spanclass="sig-paren">(</span><em>e</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#epoch2num"><spanclass="viewcode-link">[source]</span></a><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">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">num2epoch</code><spanclass="sig-paren">(</span><em>d</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#num2epoch"><spanclass="viewcode-link">[source]</span></a><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">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">mx2num</code><spanclass="sig-paren">(</span><em>mxdates</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#mx2num"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.mx2num" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">DateFormatter</code><spanclass="sig-paren">(</span><em>fmt</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateFormatter"><spanclass="viewcode-link">[source]</span></a><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"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">strftime()</span></code></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"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">strftime()</span></code></a> code
below to include dates earlier than this year.</p>
<dlclass="docutils">
<dt><em>fmt</em> is a <aclass="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">strftime()</span></code></a> format string; <em>tz</em> is the</dt>
<codeclass="descname">illegal_s</code><emclass="property"> = re.compile('((^|[^%])(%%)*%s)')</em><aclass="headerlink" href="#matplotlib.dates.DateFormatter.illegal_s" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_tzinfo</code><spanclass="sig-paren">(</span><em>tz</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateFormatter.set_tzinfo"><spanclass="viewcode-link">[source]</span></a><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">
<codeclass="descname">strftime</code><spanclass="sig-paren">(</span><em>dt</em>, <em>fmt=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateFormatter.strftime"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateFormatter.strftime" title="Permalink to this definition">¶</a></dt>
<dd><p>Refer to documentation for <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime" title="(in Python v3.7)"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">datetime.datetime.strftime()</span></code></a></p>
<p><em>fmt</em> is a <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime" title="(in Python v3.7)"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">datetime.datetime.strftime()</span></code></a> format string.</p>
<p>Warning: For years before 1900, depending upon the current
locale it is possible that the year displayed with %x might
be incorrect. For years before 100, %y and %Y will yield
<codeclass="descname">strftime_pre_1900</code><spanclass="sig-paren">(</span><em>dt</em>, <em>fmt=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateFormatter.strftime_pre_1900"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateFormatter.strftime_pre_1900" title="Permalink to this definition">¶</a></dt>
<dd><p>Call time.strftime for years before 1900 by rolling
forward a multiple of 28 years.</p>
<p><em>fmt</em> is a <aclass="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">strftime()</span></code></a> format string.</p>
<p>Dalke: I hope I did this math right. Every 28 years the
calendar repeats, except through century leap years excepting
the 400 year leap years. But only if you're using the Gregorian
calendar.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.IndexDateFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">IndexDateFormatter</code><spanclass="sig-paren">(</span><em>t</em>, <em>fmt</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#IndexDateFormatter"><spanclass="viewcode-link">[source]</span></a><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"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">IndexLocator</span></code></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
<codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">strftime()</span></code> format string.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.AutoDateFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">AutoDateFormatter</code><spanclass="sig-paren">(</span><em>locator</em>, <em>tz=None</em>, <em>defaultfmt='%Y-%m-%d'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateFormatter"><spanclass="viewcode-link">[source]</span></a><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"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></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="gp">>>> </span><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="s1">'%M:%S'</span><spanclass="c1"># only show min and sec</span>
</pre></div>
</div>
<p>A custom <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.FuncFormatter" title="matplotlib.ticker.FuncFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FuncFormatter</span></code></a> can also be used.
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
<p>Autoformat the date labels. The default format is the one to use
if none of the values in <codeclass="docutils literal notranslate"><spanclass="pre">self.scaled</span></code> are greater than the unit
returned by <codeclass="docutils literal notranslate"><spanclass="pre">locator._get_unit()</span></code>.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.DateLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">DateLocator</code><spanclass="sig-paren">(</span><em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateLocator"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateLocator" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">datalim_to_dt</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateLocator.datalim_to_dt"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateLocator.datalim_to_dt" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert axis data interval to datetime objects.</p>
</dd></dl>
<dlclass="attribute">
<dtid="matplotlib.dates.DateLocator.hms0d">
<codeclass="descname">hms0d</code><emclass="property"> = {'byhour': 0, 'byminute': 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">
<codeclass="descname">nonsingular</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateLocator.nonsingular"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateLocator.nonsingular" title="Permalink to this definition">¶</a></dt>
<dd><p>Given the proposed upper and lower extent, adjust the range
if it is too close to being singular (i.e. a range of ~0).</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.DateLocator.set_tzinfo">
<codeclass="descname">set_tzinfo</code><spanclass="sig-paren">(</span><em>tz</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateLocator.set_tzinfo"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateLocator.set_tzinfo" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">viewlim_to_dt</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DateLocator.viewlim_to_dt"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DateLocator.viewlim_to_dt" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts the view interval to datetime objects.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.RRuleLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">RRuleLocator</code><spanclass="sig-paren">(</span><em>o</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#RRuleLocator"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.RRuleLocator" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">autoscale</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#RRuleLocator.autoscale"><spanclass="viewcode-link">[source]</span></a><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><codeclass="descname">get_unit_generic</code><spanclass="sig-paren">(</span><em>freq</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#RRuleLocator.get_unit_generic"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.RRuleLocator.get_unit_generic" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#RRuleLocator.tick_values"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.RRuleLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the values of the located ticks given <strong>vmin</strong> and <strong>vmax</strong>.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>To get tick locations with the vmin and vmax values defined
automatically for the associated <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">axis</span></code> simply call
<aclass="reference internal" href="#matplotlib.dates.DateLocator" title="matplotlib.dates.DateLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">DateLocator</span></code></a> 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
<aclass="reference internal" href="#matplotlib.dates.AutoDateFormatter" title="matplotlib.dates.AutoDateFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoDateFormatter</span></code></a>. Any frequency not specified in this
dictionary is given a default value.</p>
<p><em>tz</em> is a <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">tzinfo</span></code> 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="c1"># only show every 3 hours</span>
<codeclass="descname">autoscale</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateLocator.autoscale"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.autoscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to choose the view limits intelligently.</p>
<codeclass="descname">get_locator</code><spanclass="sig-paren">(</span><em>dmin</em>, <em>dmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateLocator.get_locator"><spanclass="viewcode-link">[source]</span></a><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>
<codeclass="descname">nonsingular</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateLocator.nonsingular"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.nonsingular" title="Permalink to this definition">¶</a></dt>
<dd><p>Given the proposed upper and lower extent, adjust the range
if it is too close to being singular (i.e. a range of ~0).</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.AutoDateLocator.refresh">
<codeclass="descname">refresh</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateLocator.refresh"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.refresh" title="Permalink to this definition">¶</a></dt>
<dd><p>Refresh internal information based on current limits.</p>
<codeclass="descname">set_axis</code><spanclass="sig-paren">(</span><em>axis</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateLocator.set_axis"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.set_axis" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#AutoDateLocator.tick_values"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.AutoDateLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the values of the located ticks given <strong>vmin</strong> and <strong>vmax</strong>.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>To get tick locations with the vmin and vmax values defined
automatically for the associated <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">axis</span></code> simply call
<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">
<codeclass="descname">autoscale</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#YearLocator.autoscale"><spanclass="viewcode-link">[source]</span></a><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>
<dlclass="method">
<dtid="matplotlib.dates.YearLocator.tick_values">
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#YearLocator.tick_values"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.YearLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the values of the located ticks given <strong>vmin</strong> and <strong>vmax</strong>.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>To get tick locations with the vmin and vmax values defined
automatically for the associated <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">axis</span></code> simply call
<p>Mark every second in <em>bysecond</em>; <em>bysecond</em> can be an int or
sequence. Default is to tick every second: <codeclass="docutils literal notranslate"><spanclass="pre">bysecond</span><spanclass="pre">=</span><spanclass="pre">range(60)</span></code></p>
<p><em>interval</em> is the interval between each iteration. For
example, if <codeclass="docutils literal notranslate"><spanclass="pre">interval=2</span></code>, mark every second occurrence.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.MicrosecondLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">MicrosecondLocator</code><spanclass="sig-paren">(</span><em>interval=1</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#MicrosecondLocator"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.MicrosecondLocator" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_axis</code><spanclass="sig-paren">(</span><em>axis</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#MicrosecondLocator.set_axis"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.MicrosecondLocator.set_axis" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_data_interval</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#MicrosecondLocator.set_data_interval"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.MicrosecondLocator.set_data_interval" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_view_interval</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#MicrosecondLocator.set_view_interval"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.MicrosecondLocator.set_view_interval" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#MicrosecondLocator.tick_values"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.MicrosecondLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the values of the located ticks given <strong>vmin</strong> and <strong>vmax</strong>.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>To get tick locations with the vmin and vmax values defined
automatically for the associated <codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">axis</span></code> simply call