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 (v3.3.0). For the latest version see <ahref="https://matplotlib.org/stable/api/dates_api.html">https://matplotlib.org/stable/api/dates_api.html</a></div>
<h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.dates</span></code><aclass="headerlink" href="#matplotlib-dates" title="Permalink to this headline">¶</a></h1>
<divclass="graphviz"><imgsrc="../_images/inheritance-4aaa0ab9afa4395835eeb0b604debd878b2839b1.png" alt="Inheritance diagram of matplotlib.dates" usemap="#inheritance1bda3e63b5" class="inheritance graphviz" /></div>
<areashape="rect" id="node1" href="#matplotlib.dates.AutoDateFormatter" target="_top" title="A `.Formatter` which attempts to figure out the best format to use.  This" alt="" coords="313,71,445,92"/>
<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="185,140,259,160"/>
<areashape="rect" id="node7" href="#matplotlib.dates.ConciseDateFormatter" target="_top" title="A `.Formatter` which attempts to figure out the best format to use for the" alt="" coords="302,106,455,126"/>
<areashape="rect" id="node9" href="#matplotlib.dates.DateFormatter" target="_top" title="Format a tick (in days since the epoch) with a" alt="" coords="327,140,430,160"/>
<areashape="rect" id="node15" href="#matplotlib.dates.IndexDateFormatter" target="_top" title="[*Deprecated*] Use with `.IndexLocator` to cycle format strings by index." alt="" coords="309,174,448,194"/>
<areashape="rect" id="node3" href="#matplotlib.dates.AutoDateLocator" target="_top" title="On autoscale, this class picks the best `DateLocator` to set the view" alt="" coords="493,157,611,177"/>
<areashape="rect" id="node4" href="#matplotlib.dates.DateLocator" target="_top" title="Determines the tick locations when plotting dates." alt="" coords="334,208,423,228"/>
<areashape="rect" id="node16" href="#matplotlib.dates.MicrosecondLocator" target="_top" title="Make ticks on regular intervals of one or more microsecond(s)." alt="" coords="483,225,620,245"/>
<areashape="rect" id="node21" href="#matplotlib.dates.YearLocator" target="_top" title="Make ticks on a given day of each year that is a multiple of base." alt="" coords="509,259,594,280"/>
<areashape="rect" id="node6" href="#matplotlib.dates.DateConverter" target="_top" title="Converter for `datetime.date` and `datetime.datetime` data, or for" alt="" coords="170,37,274,57"/>
<areashape="rect" id="node8" href="units_api.html#matplotlib.units.ConversionInterface" target="_top" title="The minimal interface for a converter to take custom data types (or" alt="" coords="3,37,142,57"/>
<areashape="rect" id="node10" href="ticker_api.html#matplotlib.ticker.Locator" target="_top" title="Determine the tick locations;" alt="" coords="192,191,252,211"/>
<areashape="rect" id="node11" href="#matplotlib.dates.DayLocator" target="_top" title="Make ticks on occurrences of each day of the month.  For example," alt="" coords="665,106,749,126"/>
<areashape="rect" id="node14" href="#matplotlib.dates.HourLocator" target="_top" title="Make ticks on occurrences of each hour." alt="" coords="662,140,752,160"/>
<areashape="rect" id="node17" href="#matplotlib.dates.MinuteLocator" target="_top" title="Make ticks on occurrences of each minute." alt="" coords="656,174,758,194"/>
<areashape="rect" id="node18" href="#matplotlib.dates.MonthLocator" target="_top" title="Make ticks on occurrences of each month, e.g., 1, 3, 12." alt="" coords="657,208,756,228"/>
<areashape="rect" id="node19" href="#matplotlib.dates.SecondLocator" target="_top" title="Make ticks on occurrences of each second." alt="" coords="653,242,760,262"/>
<areashape="rect" id="node20" href="#matplotlib.dates.WeekdayLocator" target="_top" title="Make ticks on occurrences of each weekday." alt="" coords="648,276,765,297"/>
</map><spanclass="target" id="module-matplotlib.dates"></span><p>Matplotlib provides sophisticated date plotting capabilities, standing on the
shoulders of python <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#module-datetime" title="(in Python v3.8)"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">datetime</span></code></a> and the add-on module <codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">dateutil</span></code>.</p>
<divclass="section" id="matplotlib-date-format">
<spanid="date-format"></span><h2>Matplotlib date format<aclass="headerlink" href="#matplotlib-date-format" title="Permalink to this headline">¶</a></h2>
<p>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 <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime.datetime</span></code></a> 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 <aclass="reference internal" href="#matplotlib.dates.set_epoch" title="matplotlib.dates.set_epoch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dates.set_epoch</span></code></a> or
<codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=dates.epoch#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["dates.epoch"]</span></a></code> to other dates if necessary; see
<aclass="reference internal" href="../gallery/ticks_and_spines/date_precision_and_epochs.html"><spanclass="doc">Date Precision and Epochs</span></a> for a discussion.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>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:</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.8)"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">datetime</span></code></a>
<td>Convert a date string to a datenum using <aclass="reference external" href="https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse" title="(in dateutil v2.8.1)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dateutil.parser.parse</span></code></a>.</td>
<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.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">timedelta</span></code></a> object.</td>
<td>Get the epoch used by <aclass="reference internal" href="#module-matplotlib.dates" title="matplotlib.dates"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dates</span></code></a>.</td>
</tr>
</tbody>
</table>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>Like Python's <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime.datetime</span></code></a>, 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
<p>All the Matplotlib date converters, tickers and formatters are timezone aware.
If no explicit timezone is provided, <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=timezone#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["timezone"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">'UTC'</span></code>) is assumed. If you want to
use a custom time zone, pass a <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.tzinfo" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime.tzinfo</span></code></a> instance with the tz keyword
argument to <aclass="reference internal" href="#matplotlib.dates.num2date" title="matplotlib.dates.num2date"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">num2date</span></code></a>, <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.plot_date.html#matplotlib.axes.Axes.plot_date" title="matplotlib.axes.Axes.plot_date"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">plot_date</span></code></a>, and any custom date tickers or
locators you create.</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
and formatters. These are described below.</p>
<p>The <aclass="reference external" href="https://dateutil.readthedocs.io">dateutil</a> module provides additional code to handle date ticking, making it
easy to place ticks on any kinds of dates. See examples below.</p>
</div>
<divclass="section" id="date-tickers">
<h2>Date tickers<aclass="headerlink" href="#date-tickers" title="Permalink to this headline">¶</a></h2>
<p>Most of the date tickers can locate single or multiple values. For example:</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># import constants for the days of the week</span>
<li><aclass="reference internal" href="#matplotlib.dates.DayLocator" title="matplotlib.dates.DayLocator"><codeclass="xref py py-obj 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-obj 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-obj 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-obj docutils literal notranslate"><spanclass="pre">RRuleLocator</span></code></a>: Locate using a <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.dates.rrulewrapper</span></code>.
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rrulewrapper</span></code> is a simple wrapper around <aclass="reference external" href="https://dateutil.readthedocs.io">dateutil</a>'s <aclass="reference external" href="https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule" title="(in dateutil v2.8.1)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dateutil.rrule</span></code></a> which
allow almost arbitrary date tick specifications. See <aclass="reference internal" href="../gallery/ticks_and_spines/date_demo_rrule.html"><spanclass="doc">rrule example</span></a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></a>: On autoscale, this class picks the best <aclass="reference internal" href="#matplotlib.dates.DateLocator" title="matplotlib.dates.DateLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">DateLocator</span></code></a>
(e.g., <aclass="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">RRuleLocator</span></code></a>) to set the view limits and the tick 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>
<divclass="section" id="date-formatters">
<h2>Date formatters<aclass="headerlink" href="#date-formatters" title="Permalink to this headline">¶</a></h2>
<p>The available date formatters are:</p>
<ulclass="simple">
<li><aclass="reference internal" href="#matplotlib.dates.AutoDateFormatter" title="matplotlib.dates.AutoDateFormatter"><codeclass="xref py py-obj 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-obj docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.ConciseDateFormatter" title="matplotlib.dates.ConciseDateFormatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ConciseDateFormatter</span></code></a>: 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 <aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></a>.</li>
<li><aclass="reference internal" href="#matplotlib.dates.IndexDateFormatter" title="matplotlib.dates.IndexDateFormatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">IndexDateFormatter</span></code></a>: date plots with implicit <em>x</em> indexing.</li>
</ul>
<dlclass="function">
<dtid="matplotlib.dates.datestr2num">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">datestr2num</code><spanclass="sig-paren">(</span><em>d</em>, <em>default=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#datestr2num"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.datestr2num" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a date string to a datenum using <aclass="reference external" href="https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse" title="(in dateutil v2.8.1)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dateutil.parser.parse</span></code></a>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>d</strong><spanclass="classifier">str or sequence of str</span></dt><dd><p>The dates to convert.</p>
</dd>
<dt><strong>default</strong><spanclass="classifier">datetime.datetime, optional</span></dt><dd><p>The default date to use when fields are missing in <em>d</em>.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<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"><aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.8)"><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>float or sequence of floats</dt><dd><p>Number of days since the epoch. See <aclass="reference internal" href="#matplotlib.dates.get_epoch" title="matplotlib.dates.get_epoch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">get_epoch</span></code></a> for the
epoch, which can be changed by <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=date.epoch#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["date.epoch"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">'1970-01-01T00:00:00'</span></code>) or <aclass="reference internal" href="#matplotlib.dates.set_epoch" title="matplotlib.dates.set_epoch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_epoch</span></code></a>. If
the epoch is "1970-01-01T00:00:00" (default) then noon Jan 1 1970
<p>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>
<dt><strong>x</strong><spanclass="classifier">float or sequence of floats</span></dt><dd><p>Number of days (fraction part represents hours, minutes, seconds)
since the epoch. See <aclass="reference internal" href="#matplotlib.dates.get_epoch" title="matplotlib.dates.get_epoch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">get_epoch</span></code></a> for the
epoch, which can be changed by <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=date.epoch#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["date.epoch"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">'1970-01-01T00:00:00'</span></code>) or <aclass="reference internal" href="#matplotlib.dates.set_epoch" title="matplotlib.dates.set_epoch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_epoch</span></code></a>.</p>
</dd>
<dt><strong>tz</strong><spanclass="classifier">str, optional</span></dt><dd><p>Timezone of <em>x</em> (defaults to <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=timezone#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["timezone"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">'UTC'</span></code>)).</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime</span></code></a> or sequence of <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime</span></code></a></dt><dd><p>Dates are returned in timezone <em>tz</em>.</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.datetime" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">datetime</span></code></a> 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.8)"><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.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">timedelta</span></code></a> objects will
<dt><strong>x</strong><spanclass="classifier">float, sequence of floats</span></dt><dd><p>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">
<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>.
<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>[<em>Deprecated</em>] Convert an epoch or sequence of epochs to the new date format,
that is days since 0001.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.3.</span></p>
</div>
</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>[<em>Deprecated</em>] Convert days since 0001 to epoch. <em>d</em> can be a number or sequence.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.3.</span></p>
</div>
</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>
<p><spanclass="versionmodified deprecated">Deprecated since version 3.2.</span></p>
</div>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.set_epoch">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">set_epoch</code><spanclass="sig-paren">(</span><em>epoch</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#set_epoch"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.set_epoch" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the epoch (origin for dates) for datetime calculations.</p>
<p>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 fo 2^52.</p>
<p><aclass="reference internal" href="#matplotlib.dates.set_epoch" title="matplotlib.dates.set_epoch"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_epoch</span></code></a> must be called before any dates are converted
(i.e. near the import section) or a RuntimeError will be raised.</p>
<p>See also <aclass="reference internal" href="../gallery/ticks_and_spines/date_precision_and_epochs.html"><spanclass="doc">Date Precision and Epochs</span></a>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>epoch</strong><spanclass="classifier">str</span></dt><dd><p>valid UTC date parsable by <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">numpy.datetime64</span></code> (do not include
timezone).</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.dates.get_epoch">
<codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">get_epoch</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#get_epoch"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.get_epoch" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the epoch used by <aclass="reference internal" href="#module-matplotlib.dates" title="matplotlib.dates"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dates</span></code></a>.</p>
<trclass="field-odd field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt>epoch: str</dt><dd><p>String for the epoch (parsable by <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">numpy.datetime64</span></code>).</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.DateFormatter">
<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>
<emclass="property">property </em><codeclass="descname">illegal_s</code><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>self</em>, <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>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.ConciseDateFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">ConciseDateFormatter</code><spanclass="sig-paren">(</span><em>locator</em>, <em>tz=None</em>, <em>formats=None</em>, <em>offset_formats=None</em>, <em>zero_formats=None</em>, <em>show_offset=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#ConciseDateFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.ConciseDateFormatter" title="Permalink to this definition">¶</a></dt>
<p>A <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Formatter</span></code></a> 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 <aclass="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code></a>:</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>locator</strong><spanclass="classifier"><aclass="reference internal" href="ticker_api.html#matplotlib.ticker.Locator" title="matplotlib.ticker.Locator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ticker.Locator</span></code></a></span></dt><dd><p>Locator that this axis is using.</p>
<dt><strong>formats</strong><spanclass="classifier">list of 6 strings, optional</span></dt><dd><p>Format strings for 6 levels of tick labelling: mostly years,
months, days, hours, minutes, and seconds. Strings use
the same format codes as <aclass="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">strftime</span></code></a>. Default is
<dt><strong>zero_formats</strong><spanclass="classifier">list of 6 strings, optional</span></dt><dd><p>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
<dt><strong>offset_formats</strong><spanclass="classifier">list of 6 strings, optional</span></dt><dd><p>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
<dt><strong>show_offset</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>Whether to show the offset or not.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Examples</p>
<p>See <aclass="reference internal" href="../gallery/ticks_and_spines/date_concise_formatter.html"><spanclass="doc">Formatting date ticks using ConciseDateFormatter</span></a></p>
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#ConciseDateFormatter.format_data_short"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.ConciseDateFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a short string version of the tick value.</p>
<p>Defaults to the position-independent long value.</p>
<codeclass="descname">format_ticks</code><spanclass="sig-paren">(</span><em>self</em>, <em>values</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#ConciseDateFormatter.format_ticks"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.ConciseDateFormatter.format_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the tick labels for all the ticks at once.</p>
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#ConciseDateFormatter.get_offset"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.ConciseDateFormatter.get_offset" title="Permalink to this definition">¶</a></dt>
<dd></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>[<em>Deprecated</em>] Use with <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.IndexLocator" title="matplotlib.ticker.IndexLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">IndexLocator</span></code></a> to cycle format strings by index.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.3.</span></p>
<p>A <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Formatter</span></code></a> which 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-obj 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-obj 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 ticklabel:</p>
<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><em>self</em><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>self</em>, <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>self</em>, <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><em>self</em><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>Convert 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><em>self</em><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>[<em>Deprecated</em>] Set the view limits to include the data range.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.2.</span></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>self</em>, <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
<p>On autoscale, this class picks the best <aclass="reference internal" href="#matplotlib.dates.DateLocator" title="matplotlib.dates.DateLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">DateLocator</span></code></a> to set the view
<p>where the keys are defined in <aclass="reference external" href="https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule" title="(in dateutil v2.8.1)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dateutil.rrule</span></code></a>.</p>
<p>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.</p>
<p>When customizing, you should only modify the values for the existing
<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>
<dt><strong>minticks</strong><spanclass="classifier">int</span></dt><dd><p>The minimum number of ticks desired; controls whether ticks occur
yearly, monthly, etc.</p>
</dd>
<dt><strong>maxticks</strong><spanclass="classifier">int</span></dt><dd><p>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 <aclass="reference internal" href="#matplotlib.dates.AutoDateFormatter" title="matplotlib.dates.AutoDateFormatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">AutoDateFormatter</span></code></a>. Any
frequency not specified in this dictionary is given a default
value.</p>
</dd>
<dt><strong>interval_multiples</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>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
<codeclass="descname">autoscale</code><spanclass="sig-paren">(</span><em>self</em><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>[<em>Deprecated</em>] Try to choose the view limits intelligently.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.2.</span></p>
<codeclass="descname">get_locator</code><spanclass="sig-paren">(</span><em>self</em>, <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>self</em>, <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>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>self</em>, <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><em>self</em><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>[<em>Deprecated</em>] Set the view limits to include the data range.</p>
<pclass="rubric">Notes</p>
<divclass="deprecated">
<p><spanclass="versionmodified deprecated">Deprecated since version 3.2.</span></p>
</div>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.dates.YearLocator.tick_values">
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>self</em>, <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>Make ticks on occurrences of each month, e.g., 1, 3, 12.</p>
<p>Mark every month in <em>bymonth</em>; <em>bymonth</em> can be an int or
sequence. Default is <codeclass="docutils literal notranslate"><spanclass="pre">range(1,</span><spanclass="pre">13)</span></code>, i.e. every month.</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.WeekdayLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">WeekdayLocator</code><spanclass="sig-paren">(</span><em>byweekday=1</em>, <em>interval=1</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#WeekdayLocator"><spanclass="viewcode-link">[source]</span></a><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 <aclass="reference external" href="https://dateutil.readthedocs.io/en/stable/rrule.html#module-dateutil.rrule" title="(in dateutil v2.8.1)"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">dateutil.rrule</span></code></a>, which have been
imported into the <aclass="reference internal" href="#module-matplotlib.dates" title="matplotlib.dates"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.dates</span></code></a> namespace.</p>
<p><em>interval</em> specifies the number of weeks to skip. For example,
<codeclass="docutils literal notranslate"><spanclass="pre">interval=2</span></code> plots every second week.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.DayLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">DayLocator</code><spanclass="sig-paren">(</span><em>bymonthday=None</em>, <em>interval=1</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#DayLocator"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.DayLocator" title="Permalink to this definition">¶</a></dt>
<p>Make ticks on occurrences 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: <codeclass="docutils literal notranslate"><spanclass="pre">bymonthday=range(1,</span><spanclass="pre">32)</span></code>.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.dates.HourLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.dates.</code><codeclass="descname">HourLocator</code><spanclass="sig-paren">(</span><em>byhour=None</em>, <em>interval=1</em>, <em>tz=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/dates.html#HourLocator"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.dates.HourLocator" title="Permalink to this definition">¶</a></dt>