You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v2.1.2). For the latest version see <ahref="https://matplotlib.org/stable/api/ticker_api.html">https://matplotlib.org/stable/api/ticker_api.html</a></div>
<p>set the rcParam <codeclass="docutils literal"><spanclass="pre">axes.formatter.useoffset=False</span></code> to turn it off
globally, or set a different formatter.</p>
</div>
<divclass="section" id="tick-locating">
<h4>Tick locating<aclass="headerlink" href="#tick-locating" title="Permalink to this headline">¶</a></h4>
<p>The Locator class is the base class for all tick locators. The locators
handle autoscaling of the view limits based on the data limits, and the
choosing of tick locations. A useful semi-automatic tick locator is
<aclass="reference internal" href="#matplotlib.ticker.MultipleLocator" title="matplotlib.ticker.MultipleLocator"><codeclass="xref py py-obj docutils literal"><spanclass="pre">MultipleLocator</span></code></a>. It is initialized with a base, e.g., 10, and it picks
axis limits and ticks that are multiples of that base.</p>
<dd><aclass="reference internal" href="#matplotlib.ticker.MaxNLocator" title="matplotlib.ticker.MaxNLocator"><codeclass="xref py py-obj docutils literal"><spanclass="pre">MaxNLocator</span></code></a> with simple defaults. This is the default tick locator for
<dd>Locator for index plots (e.g., where <codeclass="docutils literal"><spanclass="pre">x</span><spanclass="pre">=</span><spanclass="pre">range(len(y))</span></code>).</dd>
<dd>Locator for use with with the symlog norm; works like <aclass="reference internal" href="#matplotlib.ticker.LogLocator" title="matplotlib.ticker.LogLocator"><codeclass="xref py py-obj docutils literal"><spanclass="pre">LogLocator</span></code></a> for the
part outside of the threshold and adds 0 if inside the limits.</dd>
<dd>Choose a <aclass="reference internal" href="#matplotlib.ticker.MultipleLocator" title="matplotlib.ticker.MultipleLocator"><codeclass="xref py py-obj docutils literal"><spanclass="pre">MultipleLocator</span></code></a> and dynamically reassign it for intelligent
<p>The default minor locator is <aclass="reference internal" href="#matplotlib.ticker.NullLocator" title="matplotlib.ticker.NullLocator"><codeclass="xref py py-obj docutils literal"><spanclass="pre">NullLocator</span></code></a>, i.e., no minor ticks on by default.</p>
</div>
<divclass="section" id="tick-formatting">
<h4>Tick formatting<aclass="headerlink" href="#tick-formatting" title="Permalink to this headline">¶</a></h4>
<p>Tick formatting is controlled by classes derived from Formatter. The formatter
operates on a single tick value and returns a string to the axis.</p>
<dd>Format values for log axis using <codeclass="docutils literal"><spanclass="pre">exponent</span><spanclass="pre">=</span><spanclass="pre">log_base(value)</span></code>.</dd>
<dd>Format values for log axis using <codeclass="docutils literal"><spanclass="pre">exponent</span><spanclass="pre">=</span><spanclass="pre">log_base(value)</span></code>
<p>See <aclass="reference internal" href="../gallery/ticks_and_spines/major_minor_demo.html#sphx-glr-gallery-ticks-and-spines-major-minor-demo-py"><spanclass="std std-ref">Major Minor Demo</span></a> for an
example of setting major and minor ticks. See the <aclass="reference internal" href="dates_api.html#module-matplotlib.dates" title="matplotlib.dates"><codeclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.dates</span></code></a>
module for more information and examples of using date locators and formatters.</p>
<dlclass="class">
<dtid="matplotlib.ticker.TickHelper">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">TickHelper</code><aclass="headerlink" href="#matplotlib.ticker.TickHelper" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">axis</code><emclass="property"> = None</em><aclass="headerlink" href="#matplotlib.ticker.TickHelper.axis" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">create_dummy_axis</code><spanclass="sig-paren">(</span><em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.TickHelper.create_dummy_axis" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.TickHelper.set_axis">
<codeclass="descname">set_axis</code><spanclass="sig-paren">(</span><em>axis</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.TickHelper.set_axis" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.TickHelper.set_bounds">
<codeclass="descname">set_bounds</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.TickHelper.set_bounds" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_data_interval</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.TickHelper.set_data_interval" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_view_interval</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.TickHelper.set_view_interval" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.Formatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">Formatter</code><aclass="headerlink" href="#matplotlib.ticker.Formatter" title="Permalink to this definition">¶</a></dt>
<p>Create a string based on a tick value and location.</p>
<dlclass="method">
<dtid="matplotlib.ticker.Formatter.fix_minus">
<codeclass="descname">fix_minus</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Formatter.fix_minus" title="Permalink to this definition">¶</a></dt>
<dd><p>Some classes may want to replace a hyphen for minus with the
proper unicode symbol (U+2212) for typographical correctness.
The default is to not replace it.</p>
<p>Note, if you use this method, e.g., in <aclass="reference internal" href="#matplotlib.ticker.Formatter.format_data" title="matplotlib.ticker.Formatter.format_data"><codeclass="xref py py-meth docutils literal"><spanclass="pre">format_data()</span></code></a> or
call, you probably don’t want to use it for
<aclass="reference internal" href="#matplotlib.ticker.Formatter.format_data_short" title="matplotlib.ticker.Formatter.format_data_short"><codeclass="xref py py-meth docutils literal"><spanclass="pre">format_data_short()</span></code></a> since the toolbar uses this for
interactive coord reporting and I doubt we can expect GUIs
across platforms will handle the unicode correctly. So for
now the classes that override <aclass="reference internal" href="#matplotlib.ticker.Formatter.fix_minus" title="matplotlib.ticker.Formatter.fix_minus"><codeclass="xref py py-meth docutils literal"><spanclass="pre">fix_minus()</span></code></a> should have an
<codeclass="descname">format_data</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Formatter.format_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the full string representation of the value with the
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Formatter.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>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Formatter.get_offset">
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Formatter.get_offset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.ticker.Formatter.locs">
<codeclass="descname">locs</code><emclass="property"> = []</em><aclass="headerlink" href="#matplotlib.ticker.Formatter.locs" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Formatter.set_locs">
<codeclass="descname">set_locs</code><spanclass="sig-paren">(</span><em>locs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Formatter.set_locs" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.FixedFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">FixedFormatter</code><spanclass="sig-paren">(</span><em>seq</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FixedFormatter" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FixedFormatter.get_offset" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_offset_string</code><spanclass="sig-paren">(</span><em>ofs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FixedFormatter.set_offset_string" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.NullFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">NullFormatter</code><aclass="headerlink" href="#matplotlib.ticker.NullFormatter" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">FuncFormatter</code><spanclass="sig-paren">(</span><em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FuncFormatter" title="Permalink to this definition">¶</a></dt>
<p>Use a user-defined function for formatting.</p>
<p>The function should take in two inputs (a tick value <codeclass="docutils literal"><spanclass="pre">x</span></code> and a
position <codeclass="docutils literal"><spanclass="pre">pos</span></code>), and return a string containing the corresponding
tick label.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.FormatStrFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">FormatStrFormatter</code><spanclass="sig-paren">(</span><em>fmt</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FormatStrFormatter" title="Permalink to this definition">¶</a></dt>
<p>Use an old-style (‘%’ operator) format string to format the tick.</p>
<p>The format string should have a single variable format (%) in it.
It will be applied to the value (not the position) of the tick.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.StrMethodFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">StrMethodFormatter</code><spanclass="sig-paren">(</span><em>fmt</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.StrMethodFormatter" title="Permalink to this definition">¶</a></dt>
<p>Use a new-style format string (as used by <codeclass="xref py py-obj docutils literal"><spanclass="pre">str.format()</span></code>)
to format the tick.</p>
<p>The field used for the value must be labeled <codeclass="xref py py-obj docutils literal"><spanclass="pre">x</span></code> and the field used
for the position must be labeled <codeclass="xref py py-obj docutils literal"><spanclass="pre">pos</span></code>.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.ScalarFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">ScalarFormatter</code><spanclass="sig-paren">(</span><em>useOffset=None</em>, <em>useMathText=None</em>, <em>useLocale=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter" title="Permalink to this definition">¶</a></dt>
<p>Tick value is interpreted as a plain old number. If
<codeclass="docutils literal"><spanclass="pre">useOffset==True</span></code> and the data range is much smaller than the data
average, then an offset will be determined such that the tick labels
are meaningful. Scientific notation is used for <codeclass="docutils literal"><spanclass="pre">data</span><spanclass="pre"><</span><spanclass="pre">10^-n</span></code> or
<codeclass="docutils literal"><spanclass="pre">data</span><spanclass="pre">>=</span><spanclass="pre">10^m</span></code>, where <codeclass="docutils literal"><spanclass="pre">n</span></code> and <codeclass="docutils literal"><spanclass="pre">m</span></code> are the power limits set
using <codeclass="docutils literal"><spanclass="pre">set_powerlimits((n,m))</span></code>. The defaults for these are
controlled by the <codeclass="docutils literal"><spanclass="pre">axes.formatter.limits</span></code> rc parameter.</p>
<codeclass="descname">fix_minus</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.fix_minus" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">format_data</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.format_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a formatted string representation of a number.</p>
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a short formatted string representation of a number.</p>
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_offset" title="Permalink to this definition">¶</a></dt>
<dd><p>Return scientific notation, plus offset.</p>
<codeclass="descname">get_useLocale</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_useLocale" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_useMathText</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_useMathText" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_useOffset</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_useOffset" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">pprint_val</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.pprint_val" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_locs</code><spanclass="sig-paren">(</span><em>locs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_locs" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_powerlimits</code><spanclass="sig-paren">(</span><em>lims</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_powerlimits" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets size thresholds for scientific notation.</p>
<p><codeclass="docutils literal"><spanclass="pre">lims</span></code> is a two-element sequence containing the powers of 10
that determine the switchover threshold. Numbers below
<codeclass="docutils literal"><spanclass="pre">10**lims[0]</span></code> and above <codeclass="docutils literal"><spanclass="pre">10**lims[1]</span></code> will be displayed in
scientific notation.</p>
<p>For example, <codeclass="docutils literal"><spanclass="pre">formatter.set_powerlimits((-3,</span><spanclass="pre">4))</span></code> sets the
pre-2007 default in which scientific notation is used for
<codeclass="descname">set_scientific</code><spanclass="sig-paren">(</span><em>b</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_scientific" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_useLocale</code><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_useLocale" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_useMathText</code><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_useMathText" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_useOffset</code><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_useOffset" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">useLocale</code><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.useLocale" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">useMathText</code><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.useMathText" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">useOffset</code><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.useOffset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.LogFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">LogFormatter</code><spanclass="sig-paren">(</span><em>base=10.0</em>, <em>labelOnlyBase=False</em>, <em>minor_thresholds=None</em>, <em>linthresh=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter" title="Permalink to this definition">¶</a></dt>
<div><p>If labelOnlyBase is False, these two numbers control
the labeling of ticks that are not at integer powers of
base; normally these are the minor ticks. The controlling
parameter is the log of the axis data range. In the typical
case where base is 10 it is the number of decades spanned
by the axis, so we can call it ‘numdec’. If <codeclass="docutils literal"><spanclass="pre">numdec</span><spanclass="pre"><=</span><spanclass="pre">all</span></code>,
all minor ticks will be labeled. If <codeclass="docutils literal"><spanclass="pre">all</span><spanclass="pre"><</span><spanclass="pre">numdec</span><spanclass="pre"><=</span><spanclass="pre">subset</span></code>,
then only a subset of minor ticks will be labeled, so as to
avoid crowding. If <codeclass="docutils literal"><spanclass="pre">numdec</span><spanclass="pre">></span><spanclass="pre">subset</span></code> then no minor ticks will
be labeled.</p>
</div></blockquote>
<p><strong>linthresh</strong> : None or float, optional, default: None</p>
<blockquoteclass="last">
<div><p>If a symmetric log scale is in use, its <codeclass="docutils literal"><spanclass="pre">linthresh</span></code>
parameter must be supplied here.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p>The <aclass="reference internal" href="#matplotlib.ticker.LogFormatter.set_locs" title="matplotlib.ticker.LogFormatter.set_locs"><codeclass="xref py py-obj docutils literal"><spanclass="pre">set_locs</span></code></a> method must be called to enable the subsetting
logic controlled by the <codeclass="docutils literal"><spanclass="pre">minor_thresholds</span></code> parameter.</p>
<p>In some cases such as the colorbar, there is no distinction between
major and minor ticks; the tick locations might be set manually,
or by a locator that puts ticks at integer powers of base and
at intermediate locations. For this situation, disable the
minor_thresholds logic by using <codeclass="docutils literal"><spanclass="pre">minor_thresholds=(np.inf,</span><spanclass="pre">np.inf)</span></code>,
so that all ticks will be labeled.</p>
<p>To disable labeling of minor ticks when ‘labelOnlyBase’ is False,
use <codeclass="docutils literal"><spanclass="pre">minor_thresholds=(0,</span><spanclass="pre">0)</span></code>. This is the default for the
“classic” style.</p>
<pclass="rubric">Examples</p>
<p>To label a subset of minor ticks when the view limits span up
to 2 decades, and all of the ticks when zoomed in to 0.5 decades
or less, use <codeclass="docutils literal"><spanclass="pre">minor_thresholds=(2,</span><spanclass="pre">0.5)</span></code>.</p>
<p>To label all minor ticks when the view limits span up to 1.5
decades, use <codeclass="docutils literal"><spanclass="pre">minor_thresholds=(1.5,</span><spanclass="pre">1.5)</span></code>.</p>
<dlclass="method">
<dtid="matplotlib.ticker.LogFormatter.base">
<codeclass="descname">base</code><spanclass="sig-paren">(</span><em>base</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.base" title="Permalink to this definition">¶</a></dt>
<dd><p>change the <aclass="reference internal" href="#matplotlib.ticker.LogFormatter.base" title="matplotlib.ticker.LogFormatter.base"><codeclass="xref py py-obj docutils literal"><spanclass="pre">base</span></code></a> for labeling.</p>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">Should always match the base used for <aclass="reference internal" href="#matplotlib.ticker.LogLocator" title="matplotlib.ticker.LogLocator"><codeclass="xref py py-class docutils literal"><spanclass="pre">LogLocator</span></code></a></p>
<codeclass="descname">format_data</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.format_data" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a short formatted string representation of a number.</p>
<codeclass="descname">label_minor</code><spanclass="sig-paren">(</span><em>labelOnlyBase</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.label_minor" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">pprint_val</code><spanclass="sig-paren">(</span><em>x</em>, <em>d</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.pprint_val" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.LogFormatter.set_locs">
<codeclass="descname">set_locs</code><spanclass="sig-paren">(</span><em>locs=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.set_locs" title="Permalink to this definition">¶</a></dt>
<dd><p>Use axis view limits to control which ticks are labeled.</p>
<p>The <codeclass="docutils literal"><spanclass="pre">locs</span></code> parameter is ignored in the present algorithm.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.LogFormatterExponent">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">LogFormatterExponent</code><spanclass="sig-paren">(</span><em>base=10.0</em>, <em>labelOnlyBase=False</em>, <em>minor_thresholds=None</em>, <em>linthresh=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatterExponent" title="Permalink to this definition">¶</a></dt>
<p>Format values for log axis using <codeclass="docutils literal"><spanclass="pre">exponent</span><spanclass="pre">=</span><spanclass="pre">log_base(value)</span></code>.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.LogFormatterMathtext">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">LogFormatterMathtext</code><spanclass="sig-paren">(</span><em>base=10.0</em>, <em>labelOnlyBase=False</em>, <em>minor_thresholds=None</em>, <em>linthresh=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatterMathtext" title="Permalink to this definition">¶</a></dt>
<p>Format values for log axis using <codeclass="docutils literal"><spanclass="pre">exponent</span><spanclass="pre">=</span><spanclass="pre">log_base(value)</span></code>.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.IndexFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">IndexFormatter</code><spanclass="sig-paren">(</span><em>labels</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.IndexFormatter" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">LogFormatterSciNotation</code><spanclass="sig-paren">(</span><em>base=10.0</em>, <em>labelOnlyBase=False</em>, <em>minor_thresholds=None</em>, <em>linthresh=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogFormatterSciNotation" title="Permalink to this definition">¶</a></dt>
<p>Format values following scientific notation in a logarithmic axis</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.LogitFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">LogitFormatter</code><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>value</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>return a short formatted string representation of a number</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.EngFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">EngFormatter</code><spanclass="sig-paren">(</span><em>unit=''</em>, <em>places=None</em>, <em>sep=' '</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.EngFormatter" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">format_eng</code><spanclass="sig-paren">(</span><em>num</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.EngFormatter.format_eng" title="Permalink to this definition">¶</a></dt>
<dd><p>Formats a number in engineering notation, appending a letter
representing the power of 1000 of the original number.
Some examples:</p>
<divclass="highlight-default"><divclass="highlight"><pre><span></span><spanclass="gp">>>> </span><spanclass="n">format_eng</span><spanclass="p">(</span><spanclass="mi">0</span><spanclass="p">)</span><spanclass="c1"># for self.places = 0</span>
<spanclass="go">'0'</span>
</pre></div>
</div>
<divclass="highlight-default"><divclass="highlight"><pre><span></span><spanclass="gp">>>> </span><spanclass="n">format_eng</span><spanclass="p">(</span><spanclass="mi">1000000</span><spanclass="p">)</span><spanclass="c1"># for self.places = 1</span>
<spanclass="go">'1.0 M'</span>
</pre></div>
</div>
<divclass="highlight-default"><divclass="highlight"><pre><span></span><spanclass="gp">>>> </span><spanclass="n">format_eng</span><spanclass="p">(</span><spanclass="s2">"-1e-6"</span><spanclass="p">)</span><spanclass="c1"># for self.places = 2</span>
<spanclass="go">u'-1.00 μ'</span>
</pre></div>
</div>
<p><codeclass="xref py py-obj docutils literal"><spanclass="pre">num</span></code> may be a numeric value or a string that can be converted
to a numeric value with <codeclass="docutils literal"><spanclass="pre">float(num)</span></code>.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.PercentFormatter">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">PercentFormatter</code><spanclass="sig-paren">(</span><em>xmax=100</em>, <em>decimals=None</em>, <em>symbol='%'</em>, <em>is_latex=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.PercentFormatter" title="Permalink to this definition">¶</a></dt>
<p>How the number is converted into a percentage is determined by the
<codeclass="xref py py-obj docutils literal"><spanclass="pre">xmax</span></code> parameter. <codeclass="xref py py-obj docutils literal"><spanclass="pre">xmax</span></code> is the data value that corresponds to 100%.
Percentages are computed as <codeclass="docutils literal"><spanclass="pre">x</span><spanclass="pre">/</span><spanclass="pre">xmax</span><spanclass="pre">*</span><spanclass="pre">100</span></code>. So if the data is
already scaled to be percentages, <codeclass="xref py py-obj docutils literal"><spanclass="pre">xmax</span></code> will be 100. Another common
situation is where <codeclass="xref py py-obj docutils literal"><spanclass="pre">xmax</span></code> is 1.0.</p>
<p><aclass="reference internal" href="#matplotlib.ticker.PercentFormatter.symbol" title="matplotlib.ticker.PercentFormatter.symbol"><codeclass="xref py py-obj docutils literal"><spanclass="pre">symbol</span></code></a> is a string which will be appended to the label. It may be
<aclass="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.6)"><codeclass="xref py py-obj docutils literal"><spanclass="pre">None</span></code></a> or empty to indicate that no symbol should be used. LaTeX
special characters are escaped in <aclass="reference internal" href="#matplotlib.ticker.PercentFormatter.symbol" title="matplotlib.ticker.PercentFormatter.symbol"><codeclass="xref py py-obj docutils literal"><spanclass="pre">symbol</span></code></a> whenever latex mode is
<p><codeclass="xref py py-obj docutils literal"><spanclass="pre">decimals</span></code> is the number of decimal places to place after the point.
If it is set to <aclass="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.6)"><codeclass="xref py py-obj docutils literal"><spanclass="pre">None</span></code></a> (the default), the number will be computed
<codeclass="descname">convert_to_pct</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.PercentFormatter.convert_to_pct" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">format_pct</code><spanclass="sig-paren">(</span><em>x</em>, <em>display_range</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.PercentFormatter.format_pct" title="Permalink to this definition">¶</a></dt>
<dd><p>Formats the number as a percentage number with the correct
number of decimals and adds the percent symbol, if any.</p>
<p>If <codeclass="xref py py-obj docutils literal"><spanclass="pre">self.decimals</span></code> is <aclass="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.6)"><codeclass="xref py py-obj docutils literal"><spanclass="pre">None</span></code></a>, the number of digits after the
decimal point is set based on the <codeclass="xref py py-obj docutils literal"><spanclass="pre">display_range</span></code> of the axis
<codeclass="descname">symbol</code><aclass="headerlink" href="#matplotlib.ticker.PercentFormatter.symbol" title="Permalink to this definition">¶</a></dt>
<dd><p>The configured percent symbol as a string.</p>
<p>If LaTeX is enabled via <codeclass="docutils literal"><spanclass="pre">rcParams['text.usetex']</span></code>, the special
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">Locator</code><aclass="headerlink" href="#matplotlib.ticker.Locator" title="Permalink to this definition">¶</a></dt>
<p>Note, you should not use the same locator between different
<aclass="reference internal" href="axis_api.html#matplotlib.axis.Axis" title="matplotlib.axis.Axis"><codeclass="xref py py-class docutils literal"><spanclass="pre">Axis</span></code></a> because the locator stores references to
the Axis data and view limits</p>
<dlclass="attribute">
<dtid="matplotlib.ticker.Locator.MAXTICKS">
<codeclass="descname">MAXTICKS</code><emclass="property"> = 1000</em><aclass="headerlink" href="#matplotlib.ticker.Locator.MAXTICKS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Locator.autoscale">
<codeclass="descname">autoscale</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.autoscale" title="Permalink to this definition">¶</a></dt>
<dd><p>autoscale the view limits</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Locator.pan">
<codeclass="descname">pan</code><spanclass="sig-paren">(</span><em>numsteps</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.pan" title="Permalink to this definition">¶</a></dt>
<dd><p>Pan numticks (can be positive or negative)</p>
<codeclass="descname">raise_if_exceeds</code><spanclass="sig-paren">(</span><em>locs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.raise_if_exceeds" title="Permalink to this definition">¶</a></dt>
<dd><p>raise a RuntimeError if Locator attempts to create more than
MAXTICKS locs</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Locator.refresh">
<codeclass="descname">refresh</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.refresh" title="Permalink to this definition">¶</a></dt>
<dd><p>refresh internal information based on current lim</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Locator.set_params">
<codeclass="descname">set_params</code><spanclass="sig-paren">(</span><em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.set_params" title="Permalink to this definition">¶</a></dt>
<dd><p>Do nothing, and rase a warning. Any locator class not supporting the
set_params() function will call this.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Locator.tick_values">
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.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"><spanclass="pre">axis</span></code> simply call
<codeclass="descname">view_limits</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.view_limits" title="Permalink to this definition">¶</a></dt>
<dd><p>select a scale for the range from vmin to vmax</p>
<p>Normally this method is overridden by subclasses to
change locator behaviour.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Locator.zoom">
<codeclass="descname">zoom</code><spanclass="sig-paren">(</span><em>direction</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.Locator.zoom" title="Permalink to this definition">¶</a></dt>
<dd><p>Zoom in/out on axis; if direction is >0 zoom in, else zoom out</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.IndexLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">IndexLocator</code><spanclass="sig-paren">(</span><em>base</em>, <em>offset</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.IndexLocator" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_params</code><spanclass="sig-paren">(</span><em>base=None</em>, <em>offset=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.IndexLocator.set_params" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.IndexLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.FixedLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">FixedLocator</code><spanclass="sig-paren">(</span><em>locs</em>, <em>nbins=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FixedLocator" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_params</code><spanclass="sig-paren">(</span><em>nbins=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FixedLocator.set_params" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.FixedLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd><p>”
Return the locations of the ticks.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">Because the values are fixed, vmin and vmax are not used in this
method.</p>
</div>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.ticker.NullLocator">
<emclass="property">class </em><codeclass="descclassname">matplotlib.ticker.</code><codeclass="descname">NullLocator</code><aclass="headerlink" href="#matplotlib.ticker.NullLocator" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tick_values</code><spanclass="sig-paren">(</span><em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.ticker.NullLocator.tick_values" title="Permalink to this definition">¶</a></dt>
<dd><p>”
Return the locations of the ticks.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">Because the values are Null, vmin and vmax are not used in this