Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > a44f8c7e78ee9c5838c1fb080c9e7630 > files > 1614

python-matplotlib-doc-1.1.1-1mdv2010.1.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>dates &mdash; Matplotlib v1.1.1 documentation</title>
    <link rel="stylesheet" href="../_static/mpl.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Matplotlib v1.1.1 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="top" title="Matplotlib v1.1.1 documentation" href="../index.html" />
    <link rel="up" title="The Matplotlib API" href="index.html" />
    <link rel="next" title="figure" href="figure_api.html" />
    <link rel="prev" title="colors" href="colors_api.html" /> 
  </head>
  <body>
<!-- Piwik -->
<script type="text/javascript">
if ("matplotlib.sourceforge.net" == document.location.hostname ||
    "matplotlib.sf.net" == document.location.hostname) {
  var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
  document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script type="text/javascript">
if ("matplotlib.sourceforge.net" == document.location.hostname ||
    "matplotlib.sf.net" == document.location.hostname) {
  piwik_action_name = '';
  piwik_idsite = 1;
  piwik_url = pkBaseURL + "piwik.php";
  piwik_log(piwik_action_name, piwik_idsite, piwik_url);
  document.write(unescape('%3Cobject%3E%3Cnoscript%3E%3Cp%3E%3Cimg src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/%3E%3C/p%3E%3C/noscript%3E%3C/object%3E'));
}
</script>
<!-- End Piwik Tag -->
<link rel="shortcut icon" href="_static/favicon.ico">

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="../index.html"><img src="../_static/logo2.png" border="0" alt="matplotlib"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="figure_api.html" title="figure"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="colors_api.html" title="colors"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">home</a>|&nbsp;</li>
        <li><a href="../search.html">search</a>|&nbsp;</li>
        <li><a href="../examples/index.html">examples</a>|&nbsp;</li>
        <li><a href="../gallery.html">gallery</a>|&nbsp;</li>
        <li><a href="../contents.html">docs</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">The Matplotlib API</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">dates</a><ul>
<li><a class="reference internal" href="#module-matplotlib.dates"><tt class="docutils literal"><span class="pre">matplotlib.dates</span></tt></a><ul>
<li><a class="reference internal" href="#date-tickers">Date tickers</a></li>
<li><a class="reference internal" href="#date-formatters">Date formatters</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="colors_api.html"
                        title="previous chapter">colors</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="figure_api.html"
                        title="next chapter">figure</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/api/dates_api.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="dates">
<h1>dates<a class="headerlink" href="#dates" title="Permalink to this headline">¶</a></h1>
<p class="graphviz">
digraph inheritance1bda3e63b5 {
rankdir=LR;
size=&quot;8.0, 12.0&quot;;
  &quot;YearLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.YearLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;DateLocator&quot; -&gt; &quot;YearLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;ConversionInterface&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;units_api.html#matplotlib.units.ConversionInterface&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;Locator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;ticker_api.html#matplotlib.ticker.Locator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;TickHelper&quot; -&gt; &quot;Locator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;DateFormatter&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.DateFormatter&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;Formatter&quot; -&gt; &quot;DateFormatter&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;SecondLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.SecondLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;RRuleLocator&quot; -&gt; &quot;SecondLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;DateConverter&quot; [shape=box,style=&quot;setlinewidth(0.5)&quot;,fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25];
  &quot;ConversionInterface&quot; -&gt; &quot;DateConverter&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;IndexDateFormatter&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.IndexDateFormatter&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;Formatter&quot; -&gt; &quot;IndexDateFormatter&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;AutoDateFormatter&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.AutoDateFormatter&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;Formatter&quot; -&gt; &quot;AutoDateFormatter&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;Formatter&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;ticker_api.html#matplotlib.ticker.Formatter&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;TickHelper&quot; -&gt; &quot;Formatter&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;rrulewrapper&quot; [shape=box,style=&quot;setlinewidth(0.5)&quot;,fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25];
  &quot;AutoDateLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.AutoDateLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;DateLocator&quot; -&gt; &quot;AutoDateLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;tzinfo&quot; [shape=box,style=&quot;setlinewidth(0.5)&quot;,fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25];
  &quot;TickHelper&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;ticker_api.html#matplotlib.ticker.TickHelper&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;HourLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.HourLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;RRuleLocator&quot; -&gt; &quot;HourLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;DateLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.DateLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;Locator&quot; -&gt; &quot;DateLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;_UTC&quot; [shape=box,style=&quot;setlinewidth(0.5)&quot;,fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25];
  &quot;tzinfo&quot; -&gt; &quot;_UTC&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;strpdate2num&quot; [shape=box,style=&quot;setlinewidth(0.5)&quot;,fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25];
  &quot;DayLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.DayLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;RRuleLocator&quot; -&gt; &quot;DayLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;MinuteLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.MinuteLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;RRuleLocator&quot; -&gt; &quot;MinuteLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;WeekdayLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.WeekdayLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;RRuleLocator&quot; -&gt; &quot;WeekdayLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;RRuleLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.RRuleLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;DateLocator&quot; -&gt; &quot;RRuleLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
  &quot;MonthLocator&quot; [style=&quot;setlinewidth(0.5)&quot;,URL=&quot;#matplotlib.dates.MonthLocator&quot;,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  &quot;RRuleLocator&quot; -&gt; &quot;MonthLocator&quot; [arrowsize=0.5,style=&quot;setlinewidth(0.5)&quot;];
}
</p>
<div class="section" id="module-matplotlib.dates">
<span id="matplotlib-dates"></span><h2><a class="reference internal" href="#module-matplotlib.dates" title="matplotlib.dates"><tt class="xref py py-mod docutils literal"><span class="pre">matplotlib.dates</span></tt></a><a class="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 <tt class="xref py py-mod docutils literal"><span class="pre">datetime</span></tt>, the add-on modules
<tt class="xref py py-mod docutils literal"><span class="pre">pytz</span></tt> and <tt class="xref py py-mod docutils literal"><span class="pre">dateutils</span></tt>.  <tt class="xref py py-class docutils literal"><span class="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 <a class="reference internal" href="#matplotlib.dates.date2num" title="matplotlib.dates.date2num"><tt class="xref py py-func docutils literal"><span class="pre">date2num()</span></tt></a>,
<a class="reference internal" href="#matplotlib.dates.num2date" title="matplotlib.dates.num2date"><tt class="xref py py-func docutils literal"><span class="pre">num2date()</span></tt></a> and <a class="reference internal" href="#matplotlib.dates.drange" title="matplotlib.dates.drange"><tt class="xref py py-func docutils literal"><span class="pre">drange()</span></tt></a> are used to facilitate easy
conversion to and from <tt class="xref py py-mod docutils literal"><span class="pre">datetime</span></tt> and numeric ranges.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Like Python&#8217;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
<a class="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 module we find:</p>
<div class="last highlight-python"><pre>In [31]:date(2006,4,1).toordinal() - date(1,1,1).toordinal()
Out[31]:732401</pre>
</div>
</div>
<p>A wide range of specific and general purpose date tick locators and
formatters are provided in this module.  See
<a class="reference internal" href="ticker_api.html#module-matplotlib.ticker" title="matplotlib.ticker"><tt class="xref py py-mod docutils literal"><span class="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 <tt class="file docutils literal"><span class="pre">matplotlibrc</span></tt> file.  If you leave out a
<tt class="xref py py-class docutils literal"><span class="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
<tt class="xref py py-class docutils literal"><span class="pre">pytz.timezone</span></tt> instance with the tz keyword argument to
<a class="reference internal" href="#matplotlib.dates.num2date" title="matplotlib.dates.num2date"><tt class="xref py py-func docutils literal"><span class="pre">num2date()</span></tt></a>, <tt class="xref py py-func docutils literal"><span class="pre">plot_date()</span></tt>, and any custom date tickers or
locators you create.  See <a class="reference external" href="http://pytz.sourceforge.net">pytz</a> for
information on <tt class="xref py py-mod docutils literal"><span class="pre">pytz</span></tt> and timezone handling.</p>
<p>The <a class="reference external" href="http://labix.org/python-dateutil">dateutil module</a> provides
additional code to handle date ticking, making it easy to place ticks
on any kinds of dates.  See examples below.</p>
<div class="section" id="date-tickers">
<h3>Date tickers<a class="headerlink" href="#date-tickers" title="Permalink to this headline">¶</a></h3>
<p>Most of the date tickers can locate single or multiple values.  For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># tick on mondays every week</span>
<span class="n">loc</span> <span class="o">=</span> <span class="n">WeekdayLocator</span><span class="p">(</span><span class="n">byweekday</span><span class="o">=</span><span class="n">MO</span><span class="p">,</span> <span class="n">tz</span><span class="o">=</span><span class="n">tz</span><span class="p">)</span>

<span class="c"># tick on mondays and saturdays</span>
<span class="n">loc</span> <span class="o">=</span> <span class="n">WeekdayLocator</span><span class="p">(</span><span class="n">byweekday</span><span class="o">=</span><span class="p">(</span><span class="n">MO</span><span class="p">,</span> <span class="n">SA</span><span class="p">))</span>
</pre></div>
</div>
<p>In addition, most of the constructors take an interval argument:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># tick on mondays every second week</span>
<span class="n">loc</span> <span class="o">=</span> <span class="n">WeekdayLocator</span><span class="p">(</span><span class="n">byweekday</span><span class="o">=</span><span class="n">MO</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
</pre></div>
</div>
<p>The rrule locator allows completely general date ticking:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># tick every 5th easter</span>
<span class="n">rule</span> <span class="o">=</span> <span class="n">rrulewrapper</span><span class="p">(</span><span class="n">YEARLY</span><span class="p">,</span> <span class="n">byeaster</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
<span class="n">loc</span> <span class="o">=</span> <span class="n">RRuleLocator</span><span class="p">(</span><span class="n">rule</span><span class="p">)</span>
</pre></div>
</div>
<p>Here are all the date tickers:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#matplotlib.dates.MinuteLocator" title="matplotlib.dates.MinuteLocator"><tt class="xref py py-class docutils literal"><span class="pre">MinuteLocator</span></tt></a>: locate minutes</li>
<li><a class="reference internal" href="#matplotlib.dates.HourLocator" title="matplotlib.dates.HourLocator"><tt class="xref py py-class docutils literal"><span class="pre">HourLocator</span></tt></a>: locate hours</li>
<li><a class="reference internal" href="#matplotlib.dates.DayLocator" title="matplotlib.dates.DayLocator"><tt class="xref py py-class docutils literal"><span class="pre">DayLocator</span></tt></a>: locate specifed days of the month</li>
<li><a class="reference internal" href="#matplotlib.dates.WeekdayLocator" title="matplotlib.dates.WeekdayLocator"><tt class="xref py py-class docutils literal"><span class="pre">WeekdayLocator</span></tt></a>: Locate days of the week, eg MO, TU</li>
<li><a class="reference internal" href="#matplotlib.dates.MonthLocator" title="matplotlib.dates.MonthLocator"><tt class="xref py py-class docutils literal"><span class="pre">MonthLocator</span></tt></a>: locate months, eg 7 for july</li>
<li><a class="reference internal" href="#matplotlib.dates.YearLocator" title="matplotlib.dates.YearLocator"><tt class="xref py py-class docutils literal"><span class="pre">YearLocator</span></tt></a>: locate years that are multiples of base</li>
<li><a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">RRuleLocator</span></tt></a>: locate using a
<tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.rrulewrapper</span></tt>.  The
<tt class="xref py py-class docutils literal"><span class="pre">rrulewrapper</span></tt> is a simple wrapper around a
<tt class="xref py py-class docutils literal"><span class="pre">dateutils.rrule</span></tt> (<a class="reference external" href="https://moin.conectiva.com.br/DateUtil">dateutil</a>) which allow almost
arbitrary date tick specifications.  See <a class="reference external" href="../examples/pylab_examples/date_demo_rrule.html">rrule example</a>.</li>
<li><a class="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><tt class="xref py py-class docutils literal"><span class="pre">AutoDateLocator</span></tt></a>: On autoscale, this class picks the best
<tt class="xref py py-class docutils literal"><span class="pre">MultipleDateLocator</span></tt> to set the view limits and the tick
locations.</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="date-formatters">
<h3>Date formatters<a class="headerlink" href="#date-formatters" title="Permalink to this headline">¶</a></h3>
<p>Here all all the date formatters:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#matplotlib.dates.AutoDateFormatter" title="matplotlib.dates.AutoDateFormatter"><tt class="xref py py-class docutils literal"><span class="pre">AutoDateFormatter</span></tt></a>: attempts to figure out the best format
to use.  This is most useful when used with the <a class="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><tt class="xref py py-class docutils literal"><span class="pre">AutoDateLocator</span></tt></a>.</li>
<li><a class="reference internal" href="#matplotlib.dates.DateFormatter" title="matplotlib.dates.DateFormatter"><tt class="xref py py-class docutils literal"><span class="pre">DateFormatter</span></tt></a>: use <tt class="xref py py-func docutils literal"><span class="pre">strftime()</span></tt> format strings</li>
<li><a class="reference internal" href="#matplotlib.dates.IndexDateFormatter" title="matplotlib.dates.IndexDateFormatter"><tt class="xref py py-class docutils literal"><span class="pre">IndexDateFormatter</span></tt></a>: date plots with implicit <em>x</em>
indexing.</li>
</ul>
</div></blockquote>
<dl class="function">
<dt id="matplotlib.dates.date2num">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">date2num</tt><big>(</big><em>d</em><big>)</big><a class="headerlink" href="#matplotlib.dates.date2num" title="Permalink to this definition">¶</a></dt>
<dd><p><em>d</em> is either a <tt class="xref py py-class docutils literal"><span class="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>

<dl class="function">
<dt id="matplotlib.dates.num2date">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">num2date</tt><big>(</big><em>x</em>, <em>tz=None</em><big>)</big><a class="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 <tt class="xref py py-class docutils literal"><span class="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 <tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt> objects will
be returned.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.dates.drange">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">drange</tt><big>(</big><em>dstart</em>, <em>dend</em>, <em>delta</em><big>)</big><a class="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 <tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt> instances.  <em>delta</em> is a
<tt class="xref py py-class docutils literal"><span class="pre">datetime.timedelta</span></tt> instance.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.dates.epoch2num">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">epoch2num</tt><big>(</big><em>e</em><big>)</big><a class="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>

<dl class="function">
<dt id="matplotlib.dates.num2epoch">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">num2epoch</tt><big>(</big><em>d</em><big>)</big><a class="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>

<dl class="function">
<dt id="matplotlib.dates.mx2num">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">mx2num</tt><big>(</big><em>mxdates</em><big>)</big><a class="headerlink" href="#matplotlib.dates.mx2num" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert mx <tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt> instance (or sequence of mx
instances) to the new date format.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.DateFormatter">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">DateFormatter</tt><big>(</big><em>fmt</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DateFormatter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="ticker_api.html#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.ticker.Formatter</span></tt></a></p>
<p>Tick location is seconds since the epoch.  Use a <a class="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><tt class="xref py py-func docutils literal"><span class="pre">strftime()</span></tt></a>
format string.</p>
<p>Python only supports <tt class="xref py py-mod docutils literal"><span class="pre">datetime</span></tt> <a class="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><tt class="xref py py-func docutils literal"><span class="pre">strftime()</span></tt></a> formatting
for years greater than 1900.  Thanks to Andrew Dalke, Dalke
Scientific Software who contributed the <a class="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><tt class="xref py py-func docutils literal"><span class="pre">strftime()</span></tt></a> code
below to include dates earlier than this year.</p>
<dl class="docutils">
<dt><em>fmt</em> is an <a class="reference internal" href="#matplotlib.dates.DateFormatter.strftime" title="matplotlib.dates.DateFormatter.strftime"><tt class="xref py py-func docutils literal"><span class="pre">strftime()</span></tt></a> format string; <em>tz</em> is the</dt>
<dd><tt class="xref py py-class docutils literal"><span class="pre">tzinfo</span></tt> instance.</dd>
</dl>
<dl class="method">
<dt id="matplotlib.dates.DateFormatter.set_tzinfo">
<tt class="descname">set_tzinfo</tt><big>(</big><em>tz</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DateFormatter.set_tzinfo" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="matplotlib.dates.DateFormatter.strftime">
<tt class="descname">strftime</tt><big>(</big><em>dt</em>, <em>fmt</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DateFormatter.strftime" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.IndexDateFormatter">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">IndexDateFormatter</tt><big>(</big><em>t</em>, <em>fmt</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.IndexDateFormatter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="ticker_api.html#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.ticker.Formatter</span></tt></a></p>
<p>Use with <a class="reference internal" href="ticker_api.html#matplotlib.ticker.IndexLocator" title="matplotlib.ticker.IndexLocator"><tt class="xref py py-class docutils literal"><span class="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
<tt class="xref py py-func docutils literal"><span class="pre">strftime()</span></tt> format string.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.AutoDateFormatter">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">AutoDateFormatter</tt><big>(</big><em>locator</em>, <em>tz=None</em>, <em>defaultfmt='%Y-%m-%d'</em><big>)</big><a class="headerlink" href="#matplotlib.dates.AutoDateFormatter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="ticker_api.html#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.ticker.Formatter</span></tt></a></p>
<p>This class attempts to figure out the best format to use.  This is
most useful when used with the <a class="reference internal" href="#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><tt class="xref py py-class docutils literal"><span class="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
format string.  The default looks like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="bp">self</span><span class="o">.</span><span class="n">scaled</span> <span class="o">=</span> <span class="p">{</span>
   <span class="mf">365.0</span>  <span class="p">:</span> <span class="s">&#39;%Y&#39;</span><span class="p">,</span>
   <span class="mf">30.</span>    <span class="p">:</span> <span class="s">&#39;%b %Y&#39;</span><span class="p">,</span>
   <span class="mf">1.0</span>    <span class="p">:</span> <span class="s">&#39;%b </span><span class="si">%d</span><span class="s"> %Y&#39;</span><span class="p">,</span>
   <span class="mf">1.</span><span class="o">/</span><span class="mf">24.</span> <span class="p">:</span> <span class="s">&#39;%H:%M:%D&#39;</span><span class="p">,</span>
   <span class="p">}</span>
</pre></div>
</div>
<p>The algorithm picks the key in the dictionary that is &gt;= the
current scale and uses that format string.  You can customize this
dictionary by doing:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="n">AutoDateFormatter</span><span class="p">()</span>
<span class="n">formatter</span><span class="o">.</span><span class="n">scaled</span><span class="p">[</span><span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="mf">24.</span><span class="o">*</span><span class="mf">60.</span><span class="p">)]</span> <span class="o">=</span> <span class="s">&#39;%M:%S&#39;</span> <span class="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>

<dl class="class">
<dt id="matplotlib.dates.DateLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">DateLocator</tt><big>(</big><em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DateLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="ticker_api.html#matplotlib.ticker.Locator" title="matplotlib.ticker.Locator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.ticker.Locator</span></tt></a></p>
<p><em>tz</em> is a <tt class="xref py py-class docutils literal"><span class="pre">tzinfo</span></tt> instance.</p>
<dl class="method">
<dt id="matplotlib.dates.DateLocator.datalim_to_dt">
<tt class="descname">datalim_to_dt</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.dates.DateLocator.datalim_to_dt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="matplotlib.dates.DateLocator.nonsingular">
<tt class="descname">nonsingular</tt><big>(</big><em>vmin</em>, <em>vmax</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DateLocator.nonsingular" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="matplotlib.dates.DateLocator.set_tzinfo">
<tt class="descname">set_tzinfo</tt><big>(</big><em>tz</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DateLocator.set_tzinfo" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="matplotlib.dates.DateLocator.viewlim_to_dt">
<tt class="descname">viewlim_to_dt</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.dates.DateLocator.viewlim_to_dt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.RRuleLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">RRuleLocator</tt><big>(</big><em>o</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.RRuleLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.DateLocator" title="matplotlib.dates.DateLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.DateLocator</span></tt></a></p>
<dl class="method">
<dt id="matplotlib.dates.RRuleLocator.autoscale">
<tt class="descname">autoscale</tt><big>(</big><big>)</big><a class="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>
</dd></dl>

<dl class="staticmethod">
<dt id="matplotlib.dates.RRuleLocator.get_unit_generic">
<em class="property">static </em><tt class="descname">get_unit_generic</tt><big>(</big><em>freq</em><big>)</big><a class="headerlink" href="#matplotlib.dates.RRuleLocator.get_unit_generic" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.AutoDateLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">AutoDateLocator</tt><big>(</big><em>tz=None</em>, <em>minticks=5</em>, <em>maxticks=None</em>, <em>interval_multiples=False</em><big>)</big><a class="headerlink" href="#matplotlib.dates.AutoDateLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.DateLocator" title="matplotlib.dates.DateLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.DateLocator</span></tt></a></p>
<p>On autoscale, this class picks the best
<tt class="xref py py-class docutils literal"><span class="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:<cite>AutoDateFormatter</cite>. Any frequency not specified in this
dictionary is given a default value.</p>
<p><em>tz</em> is a <tt class="xref py py-class docutils literal"><span class="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 &#8216;nicer&#8217; 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>
<div class="highlight-python"><div class="highlight"><pre><span class="bp">self</span><span class="o">.</span><span class="n">intervald</span> <span class="o">=</span> <span class="p">{</span>
  <span class="n">YEARLY</span>  <span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">10</span><span class="p">],</span>
  <span class="n">MONTHLY</span> <span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">],</span>
  <span class="n">DAILY</span>   <span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">14</span><span class="p">],</span>
  <span class="n">HOURLY</span>  <span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">12</span><span class="p">],</span>
  <span class="n">MINUTELY</span><span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">30</span><span class="p">],</span>
  <span class="n">SECONDLY</span><span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">30</span><span class="p">]</span>
  <span class="p">}</span>
</pre></div>
</div>
<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.
You can customize this dictionary by doing:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">locator</span> <span class="o">=</span> <span class="n">AutoDateLocator</span><span class="p">()</span>
<span class="n">locator</span><span class="o">.</span><span class="n">intervald</span><span class="p">[</span><span class="n">HOURLY</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="c"># only show every 3 hours</span>
</pre></div>
</div>
<dl class="method">
<dt id="matplotlib.dates.AutoDateLocator.autoscale">
<tt class="descname">autoscale</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.dates.AutoDateLocator.autoscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to choose the view limits intelligently.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.dates.AutoDateLocator.get_locator">
<tt class="descname">get_locator</tt><big>(</big><em>dmin</em>, <em>dmax</em><big>)</big><a class="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>

<dl class="method">
<dt id="matplotlib.dates.AutoDateLocator.refresh">
<tt class="descname">refresh</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.dates.AutoDateLocator.refresh" title="Permalink to this definition">¶</a></dt>
<dd><p>Refresh internal information based on current limits.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.dates.AutoDateLocator.set_axis">
<tt class="descname">set_axis</tt><big>(</big><em>axis</em><big>)</big><a class="headerlink" href="#matplotlib.dates.AutoDateLocator.set_axis" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.YearLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">YearLocator</tt><big>(</big><em>base=1</em>, <em>month=1</em>, <em>day=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.YearLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.DateLocator" title="matplotlib.dates.DateLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.DateLocator</span></tt></a></p>
<p>Make ticks on a given day of each year that is a multiple of base.</p>
<p>Examples:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Tick every year on Jan 1st</span>
<span class="n">locator</span> <span class="o">=</span> <span class="n">YearLocator</span><span class="p">()</span>

<span class="c"># Tick every 5 years on July 4th</span>
<span class="n">locator</span> <span class="o">=</span> <span class="n">YearLocator</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">month</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">day</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
</pre></div>
</div>
<p>Mark years that are multiple of base on a given month and day
(default jan 1).</p>
<dl class="method">
<dt id="matplotlib.dates.YearLocator.autoscale">
<tt class="descname">autoscale</tt><big>(</big><big>)</big><a class="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>

<dl class="class">
<dt id="matplotlib.dates.MonthLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">MonthLocator</tt><big>(</big><em>bymonth=None</em>, <em>bymonthday=1</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.MonthLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.RRuleLocator</span></tt></a></p>
<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 <tt class="docutils literal"><span class="pre">range(1,13)</span></tt>, i.e. every month.</p>
<p><em>interval</em> is the interval between each iteration.  For
example, if <tt class="docutils literal"><span class="pre">interval=2</span></tt>, mark every second occurance.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.WeekdayLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">WeekdayLocator</tt><big>(</big><em>byweekday=1</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.WeekdayLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.RRuleLocator</span></tt></a></p>
<p>Make ticks on occurances of each weekday.</p>
<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 <tt class="xref py py-mod docutils literal"><span class="pre">dateutils.rrule</span></tt>.</p>
<p><em>interval</em> specifies the number of weeks to skip.  For example,
<tt class="docutils literal"><span class="pre">interval=2</span></tt> plots every second week.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.DayLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">DayLocator</tt><big>(</big><em>bymonthday=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.DayLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.RRuleLocator</span></tt></a></p>
<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: <tt class="docutils literal"><span class="pre">bymonthday=range(1,32)</span></tt></p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.HourLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">HourLocator</tt><big>(</big><em>byhour=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.HourLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.RRuleLocator</span></tt></a></p>
<p>Make ticks on occurances of each hour.</p>
<p>Mark every hour in <em>byhour</em>; <em>byhour</em> can be an int or sequence.
Default is to tick every hour: <tt class="docutils literal"><span class="pre">byhour=range(24)</span></tt></p>
<p><em>interval</em> is the interval between each iteration.  For
example, if <tt class="docutils literal"><span class="pre">interval=2</span></tt>, mark every second occurrence.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.MinuteLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">MinuteLocator</tt><big>(</big><em>byminute=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.MinuteLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.RRuleLocator</span></tt></a></p>
<p>Make ticks on occurances of each minute.</p>
<p>Mark every minute in <em>byminute</em>; <em>byminute</em> can be an int or
sequence.  Default is to tick every minute: <tt class="docutils literal"><span class="pre">byminute=range(60)</span></tt></p>
<p><em>interval</em> is the interval between each iteration.  For
example, if <tt class="docutils literal"><span class="pre">interval=2</span></tt>, mark every second occurrence.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.SecondLocator">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">SecondLocator</tt><big>(</big><em>bysecond=None</em>, <em>interval=1</em>, <em>tz=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.SecondLocator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.dates.RRuleLocator" title="matplotlib.dates.RRuleLocator"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.dates.RRuleLocator</span></tt></a></p>
<p>Make ticks on occurances of each second.</p>
<p>Mark every second in <em>bysecond</em>; <em>bysecond</em> can be an int or
sequence.  Default is to tick every second: <tt class="docutils literal"><span class="pre">bysecond</span> <span class="pre">=</span> <span class="pre">range(60)</span></tt></p>
<p><em>interval</em> is the interval between each iteration.  For
example, if <tt class="docutils literal"><span class="pre">interval=2</span></tt>, mark every second occurrence.</p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.rrule">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">rrule</tt><big>(</big><em>freq</em>, <em>dtstart=None</em>, <em>interval=1</em>, <em>wkst=None</em>, <em>count=None</em>, <em>until=None</em>, <em>bysetpos=None</em>, <em>bymonth=None</em>, <em>bymonthday=None</em>, <em>byyearday=None</em>, <em>byeaster=None</em>, <em>byweekno=None</em>, <em>byweekday=None</em>, <em>byhour=None</em>, <em>byminute=None</em>, <em>bysecond=None</em>, <em>cache=False</em><big>)</big><a class="headerlink" href="#matplotlib.dates.rrule" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">dateutil.rrule.rrulebase</span></tt></p>
</dd></dl>

<dl class="class">
<dt id="matplotlib.dates.relativedelta">
<em class="property">class </em><tt class="descclassname">matplotlib.dates.</tt><tt class="descname">relativedelta</tt><big>(</big><em>dt1=None</em>, <em>dt2=None</em>, <em>years=0</em>, <em>months=0</em>, <em>days=0</em>, <em>leapdays=0</em>, <em>weeks=0</em>, <em>hours=0</em>, <em>minutes=0</em>, <em>seconds=0</em>, <em>microseconds=0</em>, <em>year=None</em>, <em>month=None</em>, <em>day=None</em>, <em>weekday=None</em>, <em>yearday=None</em>, <em>nlyearday=None</em>, <em>hour=None</em>, <em>minute=None</em>, <em>second=None</em>, <em>microsecond=None</em><big>)</big><a class="headerlink" href="#matplotlib.dates.relativedelta" title="Permalink to this definition">¶</a></dt>
<dd><p>The relativedelta type is based on the specification of the excelent
work done by M.-A. Lemburg in his mx.DateTime extension. However,
notice that this type does <em>NOT</em> implement the same algorithm as
his work. Do <em>NOT</em> expect it to behave like mx.DateTime&#8217;s counterpart.</p>
<p>There&#8217;s two different ways to build a relativedelta instance. The
first one is passing it two date/datetime classes:</p>
<blockquote>
<div>relativedelta(datetime1, datetime2)</div></blockquote>
<p>And the other way is to use the following keyword arguments:</p>
<blockquote>
<div><dl class="docutils">
<dt>year, month, day, hour, minute, second, microsecond:</dt>
<dd>Absolute information.</dd>
<dt>years, months, weeks, days, hours, minutes, seconds, microseconds:</dt>
<dd>Relative information, may be negative.</dd>
<dt>weekday:</dt>
<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>
<ol class="arabic simple">
<li>Calculate the absolute year, using the &#8216;year&#8217; argument, or the
original datetime year, if the argument is not present.</li>
<li>Add the relative &#8216;years&#8217; argument to the absolute year.</li>
<li>Do steps 1 and 2 for month/months.</li>
<li>Calculate the absolute day, using the &#8216;day&#8217; 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 &#8216;days&#8217; argument to the absolute day. Notice
that the &#8216;weeks&#8217; argument is multiplied by 7 and added to
&#8216;days&#8217;.</li>
<li>Do steps 1 and 2 for hour/hours, minute/minutes, second/seconds,
microsecond/microseconds.</li>
<li>If the &#8216;weekday&#8217; 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&#8217;t change the day.</li>
</ol>
</dd></dl>

<dl class="function">
<dt id="matplotlib.dates.seconds">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">seconds</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#matplotlib.dates.seconds" title="Permalink to this definition">¶</a></dt>
<dd><p>Return seconds as days.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.dates.minutes">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">minutes</tt><big>(</big><em>m</em><big>)</big><a class="headerlink" href="#matplotlib.dates.minutes" title="Permalink to this definition">¶</a></dt>
<dd><p>Return minutes as days.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.dates.hours">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">hours</tt><big>(</big><em>h</em><big>)</big><a class="headerlink" href="#matplotlib.dates.hours" title="Permalink to this definition">¶</a></dt>
<dd><p>Return hours as days.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.dates.weeks">
<tt class="descclassname">matplotlib.dates.</tt><tt class="descname">weeks</tt><big>(</big><em>w</em><big>)</big><a class="headerlink" href="#matplotlib.dates.weeks" title="Permalink to this definition">¶</a></dt>
<dd><p>Return weeks as days.</p>
</dd></dl>

</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="figure_api.html" title="figure"
             >next</a> |</li>
        <li class="right" >
          <a href="colors_api.html" title="colors"
             >previous</a> |</li>
        <li><a href="../index.html">home</a>|&nbsp;</li>
        <li><a href="../search.html">search</a>|&nbsp;</li>
        <li><a href="../examples/index.html">examples</a>|&nbsp;</li>
        <li><a href="../gallery.html">gallery</a>|&nbsp;</li>
        <li><a href="../contents.html">docs</a> &raquo;</li>

          <li><a href="index.html" >The Matplotlib API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2008, John Hunter, Darren Dale, Michael Droettboom.
      Last updated on Oct 04, 2012.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>