You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v3.3.0). For the latest version see <ahref="https://matplotlib.org/stable/api/ticker_api.html">https://matplotlib.org/stable/api/ticker_api.html</a></div>
<spanid="matplotlib-ticker"></span><h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.ticker</span></code><aclass="headerlink" href="#module-matplotlib.ticker" title="Permalink to this headline">¶</a></h1>
<h2>Tick locating and formatting<aclass="headerlink" href="#tick-locating-and-formatting" title="Permalink to this headline">¶</a></h2>
<p>This module contains classes for configuring tick locating and formatting.
Generic tick locators and formatters are provided, as well as domain specific
custom ones.</p>
<p>Although the locators know nothing about major or minor ticks, they are used
by the Axis class to support major and minor tick locating and formatting.</p>
<divclass="section" id="tick-locating">
<h3>Tick locating<aclass="headerlink" href="#tick-locating" title="Permalink to this headline">¶</a></h3>
<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 notranslate"><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>
<p>The Locator subclasses defined here are</p>
<dlclass="docutils">
<dt><aclass="reference internal" href="#matplotlib.ticker.AutoLocator" title="matplotlib.ticker.AutoLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoLocator</span></code></a></dt><dd><aclass="reference internal" href="#matplotlib.ticker.MaxNLocator" title="matplotlib.ticker.MaxNLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">MaxNLocator</span></code></a> with simple defaults. This is the default tick locator for
most plotting.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.MaxNLocator" title="matplotlib.ticker.MaxNLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">MaxNLocator</span></code></a></dt><dd>Finds up to a max number of intervals with ticks at nice locations.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.LinearLocator" title="matplotlib.ticker.LinearLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">LinearLocator</span></code></a></dt><dd>Space ticks evenly from min to max.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.LogLocator" title="matplotlib.ticker.LogLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">LogLocator</span></code></a></dt><dd>Space ticks logarithmically from min to max.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.MultipleLocator" title="matplotlib.ticker.MultipleLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">MultipleLocator</span></code></a></dt><dd>Ticks and range are a multiple of base; either integer or float.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.SymmetricalLogLocator" title="matplotlib.ticker.SymmetricalLogLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">SymmetricalLogLocator</span></code></a></dt><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 notranslate"><spanclass="pre">LogLocator</span></code></a> for the
part outside of the threshold and adds 0 if inside the limits.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.OldAutoLocator" title="matplotlib.ticker.OldAutoLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">OldAutoLocator</span></code></a></dt><dd>Choose a <aclass="reference internal" href="#matplotlib.ticker.MultipleLocator" title="matplotlib.ticker.MultipleLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">MultipleLocator</span></code></a> and dynamically reassign it for intelligent
ticking during navigation.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.AutoMinorLocator" title="matplotlib.ticker.AutoMinorLocator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">AutoMinorLocator</span></code></a></dt><dd>Locator for minor ticks when the axis is linear and the
major ticks are uniformly spaced. Subdivides the major
tick interval into a specified number of minor intervals,
defaulting to 4 or 5 depending on the major interval.</dd>
</dl>
<p>There are a number of locators specialized for date locations - see
<p>The default minor locator is <aclass="reference internal" href="#matplotlib.ticker.NullLocator" title="matplotlib.ticker.NullLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">NullLocator</span></code></a>, i.e., no minor ticks on by default.</p>
</div>
<divclass="section" id="tick-formatting">
<h3>Tick formatting<aclass="headerlink" href="#tick-formatting" title="Permalink to this headline">¶</a></h3>
<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>
<dlclass="docutils">
<dt><aclass="reference internal" href="#matplotlib.ticker.NullFormatter" title="matplotlib.ticker.NullFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">NullFormatter</span></code></a></dt><dd>No labels on the ticks.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.IndexFormatter" title="matplotlib.ticker.IndexFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">IndexFormatter</span></code></a></dt><dd>Set the strings from a list of labels.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.FixedFormatter" title="matplotlib.ticker.FixedFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FixedFormatter</span></code></a></dt><dd>Set the strings manually for the labels.</dd>
<dt><aclass="reference internal" href="#matplotlib.ticker.FuncFormatter" title="matplotlib.ticker.FuncFormatter"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FuncFormatter</span></code></a></dt><dd>User defined function sets the labels.</dd>
<p>In addition to a <aclass="reference internal" href="#matplotlib.ticker.Formatter" title="matplotlib.ticker.Formatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Formatter</span></code></a> instance, <aclass="reference internal" href="_as_gen/matplotlib.axis.Axis.set_major_formatter.html#matplotlib.axis.Axis.set_major_formatter" title="matplotlib.axis.Axis.set_major_formatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_major_formatter</span></code></a> and
<aclass="reference internal" href="_as_gen/matplotlib.axis.Axis.set_minor_formatter.html#matplotlib.axis.Axis.set_minor_formatter" title="matplotlib.axis.Axis.set_minor_formatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_minor_formatter</span></code></a> also accept a <codeclass="docutils literal notranslate"><spanclass="pre">str</span></code> or function. <codeclass="docutils literal notranslate"><spanclass="pre">str</span></code> input
will be internally replaced with an autogenerated <aclass="reference internal" href="#matplotlib.ticker.StrMethodFormatter" title="matplotlib.ticker.StrMethodFormatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">StrMethodFormatter</span></code></a> with
the input <codeclass="docutils literal notranslate"><spanclass="pre">str</span></code>. For function input, a <aclass="reference internal" href="#matplotlib.ticker.FuncFormatter" title="matplotlib.ticker.FuncFormatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FuncFormatter</span></code></a> with the input
function will be generated and used.</p>
<p>See <aclass="reference internal" href="../gallery/ticks_and_spines/major_minor_demo.html"><spanclass="doc">Major and minor ticks</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 notranslate"><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="reference internal" href="../_modules/matplotlib/ticker.html#TickHelper"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#TickHelper.create_dummy_axis"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>axis</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#TickHelper.set_axis"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#TickHelper.set_bounds"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#TickHelper.set_data_interval"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>vmin</em>, <em>vmax</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#TickHelper.set_view_interval"><spanclass="viewcode-link">[source]</span></a><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="reference internal" href="../_modules/matplotlib/ticker.html#Formatter"><spanclass="viewcode-link">[source]</span></a><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">
<emclass="property">static </em><codeclass="descname">fix_minus</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#Formatter.fix_minus"><spanclass="viewcode-link">[source]</span></a><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. This is a
helper method to perform such a replacement when it is enabled via
<codeclass="descname">format_data</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#Formatter.format_data"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.Formatter.format_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the full string representation of the value with the
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#Formatter.format_data_short"><spanclass="viewcode-link">[source]</span></a><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.format_ticks">
<codeclass="descname">format_ticks</code><spanclass="sig-paren">(</span><em>self</em>, <em>values</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#Formatter.format_ticks"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.Formatter.format_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the tick labels for all the ticks at once.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.Formatter.get_offset">
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#Formatter.get_offset"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>locs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#Formatter.set_locs"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.Formatter.set_locs" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the locations of the ticks.</p>
<p>This method is called before computing the tick labels because some
formatters need to know all tick locations to do so.</p>
</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="reference internal" href="../_modules/matplotlib/ticker.html#FixedFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.FixedFormatter" title="Permalink to this definition">¶</a></dt>
<p>Return fixed strings for tick labels based only on position, not value.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last"><aclass="reference internal" href="#matplotlib.ticker.FixedFormatter" title="matplotlib.ticker.FixedFormatter"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FixedFormatter</span></code></a> should only be used together with <aclass="reference internal" href="#matplotlib.ticker.FixedLocator" title="matplotlib.ticker.FixedLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FixedLocator</span></code></a>.
Otherwise, the labels may end up in unexpected positions.</p>
</div>
<p>Set the sequence <em>seq</em> of strings that will be used for labels.</p>
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#FixedFormatter.get_offset"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>ofs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#FixedFormatter.set_offset_string"><spanclass="viewcode-link">[source]</span></a><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="reference internal" href="../_modules/matplotlib/ticker.html#NullFormatter"><spanclass="viewcode-link">[source]</span></a><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="reference internal" href="../_modules/matplotlib/ticker.html#FuncFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.FuncFormatter" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#FuncFormatter.get_offset"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.FuncFormatter.get_offset" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_offset_string</code><spanclass="sig-paren">(</span><em>self</em>, <em>ofs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#FuncFormatter.set_offset_string"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.FuncFormatter.set_offset_string" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</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="reference internal" href="../_modules/matplotlib/ticker.html#FormatStrFormatter"><spanclass="viewcode-link">[source]</span></a><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="reference internal" href="../_modules/matplotlib/ticker.html#StrMethodFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.StrMethodFormatter" title="Permalink to this definition">¶</a></dt>
<p>Use a new-style format string (as used by <aclass="reference external" href="https://docs.python.org/3/library/stdtypes.html#str.format" title="(in Python v3.8)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">str.format</span></code></a>) to format the tick.</p>
<p>The field used for the tick value must be labeled <em>x</em> and the field used
for the tick position must be labeled <em>pos</em>.</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="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>useOffset</strong><spanclass="classifier">bool or float, default: <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=axes.formatter.useoffset#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["axes.formatter.useoffset"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>)</span></dt><dd><p>Whether to use offset notation. See <aclass="reference internal" href="#matplotlib.ticker.ScalarFormatter.set_useOffset" title="matplotlib.ticker.ScalarFormatter.set_useOffset"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_useOffset</span></code></a>.</p>
</dd>
<dt><strong>useMathText</strong><spanclass="classifier">bool, default: <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["axes.formatter.use_mathtext"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>)</span></dt><dd><p>Whether to use fancy math formatting. See <aclass="reference internal" href="#matplotlib.ticker.ScalarFormatter.set_useMathText" title="matplotlib.ticker.ScalarFormatter.set_useMathText"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_useMathText</span></code></a>.</p>
</dd>
<dt><strong>useLocale</strong><spanclass="classifier">bool, default: <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=axes.formatter.use_locale#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["axes.formatter.use_locale"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>).</span></dt><dd><p>Whether to use locale settings for decimal sign and positive sign.
See <aclass="reference internal" href="#matplotlib.ticker.ScalarFormatter.set_useLocale" title="matplotlib.ticker.ScalarFormatter.set_useLocale"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_useLocale</span></code></a>.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p>In addition to the parameters above, the formatting of scientific vs.
floating point representation can be configured via <aclass="reference internal" href="#matplotlib.ticker.ScalarFormatter.set_scientific" title="matplotlib.ticker.ScalarFormatter.set_scientific"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_scientific</span></code></a>
and <aclass="reference internal" href="#matplotlib.ticker.ScalarFormatter.set_powerlimits" title="matplotlib.ticker.ScalarFormatter.set_powerlimits"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">set_powerlimits</span></code></a>).</p>
<p><strong>Offset notation and scientific notation</strong></p>
<p>Offset notation and scientific notation look quite similar at first sight.
Both split some information from the formatted tick values and display it
at the end of the axis.</p>
<ulclass="simple">
<li>The scientific notation splits up the order of magnitude, i.e. a
multiplicative scaling factor, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">1e6</span></code>.</li>
<li>The offset notation separates an additive constant, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">+1e6</span></code>. The
offset notation label is always prefixed with a <codeclass="docutils literal notranslate"><spanclass="pre">+</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">-</span></code> sign
and is thus distinguishable from the order of magnitude label.</li>
</ul>
<p>The following plot with x limits <codeclass="docutils literal notranslate"><spanclass="pre">1_000_000</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">1_000_010</span></code> illustrates
the different formatting. Note the labels at the right edge of the x axis.</p>
<codeclass="descname">format_data</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.format_data"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.format_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the full string representation of the value with the
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.format_data_short"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a short string version of the tick value.</p>
<p>Defaults to the position-independent long value.</p>
<codeclass="descname">get_offset</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.get_offset"><spanclass="viewcode-link">[source]</span></a><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><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.get_useLocale"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_useLocale" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether locale settings are used for formatting.</p>
<codeclass="descname">get_useMathText</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.get_useMathText"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_useMathText" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether to use fancy math formatting.</p>
<codeclass="descname">get_useOffset</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.get_useOffset"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.get_useOffset" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether automatic mode for offset notation is active.</p>
<p>This returns True if <codeclass="docutils literal notranslate"><spanclass="pre">set_useOffset(True)</span></code>; it returns False if an
explicit offset was set, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">set_useOffset(1000)</span></code>.</p>
<codeclass="descname">set_locs</code><spanclass="sig-paren">(</span><em>self</em>, <em>locs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.set_locs"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_locs" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the locations of the ticks.</p>
<p>This method is called before computing the tick labels because some
formatters need to know all tick locations to do so.</p>
<codeclass="descname">set_powerlimits</code><spanclass="sig-paren">(</span><em>self</em>, <em>lims</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.set_powerlimits"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_powerlimits" title="Permalink to this definition">¶</a></dt>
<dd><p>Set size thresholds for scientific notation.</p>
scientific notation will be used if <codeclass="docutils literal notranslate"><spanclass="pre">exp</span><spanclass="pre"><=</span><spanclass="pre">min_exp</span></code> or
<p>The default limits are controlled by <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=axes.formatter.limits#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["axes.formatter.limits"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">[-5,</span><spanclass="pre">6]</span></code>).</p>
<p>In particular numbers with <em>exp</em> equal to the thresholds are
written in scientific notation.</p>
<p>Typically, <em>min_exp</em> will be negative and <em>max_exp</em> will be
positive.</p>
<p>For example, <codeclass="docutils literal notranslate"><spanclass="pre">formatter.set_powerlimits((-3,</span><spanclass="pre">4))</span></code> will provide
<codeclass="descname">set_scientific</code><spanclass="sig-paren">(</span><em>self</em>, <em>b</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.set_scientific"><spanclass="viewcode-link">[source]</span></a><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>self</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.set_useLocale"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_useLocale" title="Permalink to this definition">¶</a></dt>
<dd><p>Set whether to use locale settings for decimal sign and positive sign.</p>
<codeclass="descname">set_useMathText</code><spanclass="sig-paren">(</span><em>self</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.set_useMathText"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_useMathText" title="Permalink to this definition">¶</a></dt>
<dd><p>Set whether to use fancy math formatting.</p>
<p>If active, scientific notation is formatted as <spanclass="math notranslate nohighlight">\(1.2 \times 10^3\)</span>.</p>
<codeclass="descname">set_useOffset</code><spanclass="sig-paren">(</span><em>self</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#ScalarFormatter.set_useOffset"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.set_useOffset" title="Permalink to this definition">¶</a></dt>
<dd><p>Set whether to use offset notation.</p>
<p>When formatting a set numbers whose value is large compared to their
range, the formatter can separate an additive constant. This can
shorten the formatted numbers so that they are less likely to overlap
<p>will be formatted as <codeclass="docutils literal notranslate"><spanclass="pre">0,</span><spanclass="pre">2,</span><spanclass="pre">4,</span><spanclass="pre">6,</span><spanclass="pre">8</span></code> plus an offset <codeclass="docutils literal notranslate"><spanclass="pre">+1e5</span></code>, which
<emclass="property">property </em><codeclass="descname">useLocale</code><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.useLocale" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether locale settings are used for formatting.</p>
<emclass="property">property </em><codeclass="descname">useMathText</code><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.useMathText" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether to use fancy math formatting.</p>
<emclass="property">property </em><codeclass="descname">useOffset</code><aclass="headerlink" href="#matplotlib.ticker.ScalarFormatter.useOffset" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether automatic mode for offset notation is active.</p>
<p>This returns True if <codeclass="docutils literal notranslate"><spanclass="pre">set_useOffset(True)</span></code>; it returns False if an
explicit offset was set, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">set_useOffset(1000)</span></code>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>base</strong><spanclass="classifier">float, default: 10.</span></dt><dd><p>Base of the logarithm used in all calculations.</p>
</dd>
<dt><strong>labelOnlyBase</strong><spanclass="classifier">bool, default: False</span></dt><dd><p>If True, label ticks only at integer powers of base.
This is normally True for major ticks and False for
minor ticks.</p>
</dd>
<dt><strong>minor_thresholds</strong><spanclass="classifier">(subset, all), default: (1, 0.4)</span></dt><dd><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 notranslate"><spanclass="pre">numdec</span><spanclass="pre"><=</span><spanclass="pre">all</span></code>,
all minor ticks will be labeled. If <codeclass="docutils literal notranslate"><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 notranslate"><spanclass="pre">numdec</span><spanclass="pre">></span><spanclass="pre">subset</span></code> then no minor ticks will
be labeled.</p>
</dd>
<dt><strong>linthresh</strong><spanclass="classifier">None or float, default: None</span></dt><dd><p>If a symmetric log scale is in use, its <codeclass="docutils literal notranslate"><spanclass="pre">linthresh</span></code>
parameter must be supplied here.</p>
</dd>
</dl>
</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 notranslate"><spanclass="pre">set_locs</span></code></a> method must be called to enable the subsetting
logic controlled by the <codeclass="docutils literal notranslate"><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 notranslate"><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 notranslate"><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 notranslate"><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 notranslate"><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>self</em>, <em>base</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatter.base"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.base" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the <em>base</em> 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 notranslate"><spanclass="pre">LogLocator</span></code></a></p>
<codeclass="descname">format_data</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatter.format_data"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.format_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the full string representation of the value with the
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatter.format_data_short"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a short string version of the tick value.</p>
<p>Defaults to the position-independent long value.</p>
<codeclass="descname">label_minor</code><spanclass="sig-paren">(</span><em>self</em>, <em>labelOnlyBase</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatter.label_minor"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogFormatter.label_minor" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>labelOnlyBase</strong><spanclass="classifier">bool</span></dt><dd><p>If True, label ticks only at integer powers of base.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.ticker.LogFormatter.set_locs">
<codeclass="descname">set_locs</code><spanclass="sig-paren">(</span><em>self</em>, <em>locs=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatter.set_locs"><spanclass="viewcode-link">[source]</span></a><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 <em>locs</em> 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="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatterExponent"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogFormatterExponent" title="Permalink to this definition">¶</a></dt>
<p>Format values for log axis using <codeclass="docutils literal notranslate"><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="reference internal" href="../_modules/matplotlib/ticker.html#LogFormatterMathtext"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogFormatterMathtext" title="Permalink to this definition">¶</a></dt>
<p>Format values for log axis using <codeclass="docutils literal notranslate"><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="reference internal" href="../_modules/matplotlib/ticker.html#IndexFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.IndexFormatter" title="Permalink to this definition">¶</a></dt>
<p>[<em>Deprecated</em>] Format the position x to the nearest i-th label where <codeclass="docutils literal notranslate"><spanclass="pre">i</span><spanclass="pre">=</span><spanclass="pre">int(x</span><spanclass="pre">+</span><spanclass="pre">0.5)</span></code>.
Positions where <codeclass="docutils literal notranslate"><spanclass="pre">i</span><spanclass="pre"><</span><spanclass="pre">0</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">i</span><spanclass="pre">></span><spanclass="pre">len(list)</span></code> have no tick labels.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>use_overline</strong><spanclass="classifier">bool, default: False</span></dt><dd><p>If x > 1/2, with x = 1-v, indicate if x should be displayed as
$overline{v}$. The default is to display $1-v$.</p>
</dd>
<dt><strong>one_half</strong><spanclass="classifier">str, default: r"frac{1}{2}"</span></dt><dd><p>The string used to represent 1/2.</p>
</dd>
<dt><strong>minor</strong><spanclass="classifier">bool, default: False</span></dt><dd><p>Indicate if the formatter is formatting minor ticks or not.
Basically minor ticks are not labelled, except when only few ticks
are provided, ticks with most space with neighbor ticks are
labelled. See other parameters to change the default behavior.</p>
</dd>
<dt><strong>minor_threshold</strong><spanclass="classifier">int, default: 25</span></dt><dd><p>Maximum number of locs for labelling some minor ticks. This
parameter have no effect if minor is False.</p>
</dd>
<dt><strong>minor_number</strong><spanclass="classifier">int, default: 6</span></dt><dd><p>Number of ticks which are labelled when the number of ticks is
<codeclass="descname">format_data_short</code><spanclass="sig-paren">(</span><em>self</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogitFormatter.format_data_short"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.format_data_short" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a short string version of the tick value.</p>
<p>Defaults to the position-independent long value.</p>
<codeclass="descname">set_locs</code><spanclass="sig-paren">(</span><em>self</em>, <em>locs</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogitFormatter.set_locs"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.set_locs" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the locations of the ticks.</p>
<p>This method is called before computing the tick labels because some
formatters need to know all tick locations to do so.</p>
<codeclass="descname">set_minor_number</code><spanclass="sig-paren">(</span><em>self</em>, <em>minor_number</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogitFormatter.set_minor_number"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.set_minor_number" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the number of minor ticks to label when some minor ticks are
<codeclass="descname">set_minor_threshold</code><spanclass="sig-paren">(</span><em>self</em>, <em>minor_threshold</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogitFormatter.set_minor_threshold"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.set_minor_threshold" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the threshold for labelling minors ticks.</p>
<codeclass="descname">set_one_half</code><spanclass="sig-paren">(</span><em>self</em>, <em>one_half</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogitFormatter.set_one_half"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.set_one_half" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the way one half is displayed.</p>
<dlclass="docutils">
<dt>one_half<spanclass="classifier">str, default: r"frac{1}{2}"</span></dt><dd>The string used to represent 1/2.</dd>
<codeclass="descname">use_overline</code><spanclass="sig-paren">(</span><em>self</em>, <em>use_overline</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#LogitFormatter.use_overline"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.LogitFormatter.use_overline" title="Permalink to this definition">¶</a></dt>
<dd><p>Switch display mode with overline for labelling p>1/2.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>use_overline</strong><spanclass="classifier">bool, default: False</span></dt><dd><p>If x > 1/2, with x = 1-v, indicate if x should be displayed as
$overline{v}$. The default is to display $1-v$.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</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>, <em>*</em>, <em>usetex=None</em>, <em>useMathText=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#EngFormatter"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.EngFormatter" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>unit</strong><spanclass="classifier">str, default: ""</span></dt><dd><p>Unit symbol to use, suitable for use with single-letter
representations of powers of 1000. For example, 'Hz' or 'm'.</p>
</dd>
<dt><strong>places</strong><spanclass="classifier">int, default: None</span></dt><dd><p>Precision with which to display the number, specified in
digits after the decimal point (there will be between one
and three digits before the decimal point). If it is None,
the formatting falls back to the floating point format '%g',
which displays up to 6 <em>significant</em> digits, i.e. the equivalent
value for <em>places</em> varies between 0 and 5 (inclusive).</p>
</dd>
<dt><strong>sep</strong><spanclass="classifier">str, default: " "</span></dt><dd><p>Separator used between the value and the prefix/unit. For
example, one get '3.14 mV' if <codeclass="docutils literal notranslate"><spanclass="pre">sep</span></code> is " " (default) and
'3.14mV' if <codeclass="docutils literal notranslate"><spanclass="pre">sep</span></code> is "". Besides the default behavior, some
other useful options may be:</p>
<ulclass="simple">
<li><codeclass="docutils literal notranslate"><spanclass="pre">sep=""</span></code> to append directly the prefix/unit to the value;</li>
<dt><strong>usetex</strong><spanclass="classifier">bool, default: <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=text.usetex#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["text.usetex"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>)</span></dt><dd><p>To enable/disable the use of TeX's math mode for rendering the
numbers in the formatter.</p>
</dd>
<dt><strong>useMathText</strong><spanclass="classifier">bool, default: <codeclass="docutils literal notranslate"><aclass="reference external" href="../tutorials/introductory/customizing.html?highlight=axes.formatter.use_mathtext#a-sample-matplotlibrc-file"><spanclass="pre">rcParams["axes.formatter.use_mathtext"]</span></a></code> (default: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>)</span></dt><dd><p>To enable/disable the use mathtext for rendering the numbers in
<codeclass="descname">format_eng</code><spanclass="sig-paren">(</span><em>self</em>, <em>num</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#EngFormatter.format_eng"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.EngFormatter.format_eng" title="Permalink to this definition">¶</a></dt>
<dd><p>Format a number in engineering notation, appending a letter
representing the power of 1000 of the original number.
Some examples:</p>
<divclass="highlight-default notranslate"><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 notranslate"><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 notranslate"><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>
<codeclass="descname">get_useMathText</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#EngFormatter.get_useMathText"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.EngFormatter.get_useMathText" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_usetex</code><spanclass="sig-paren">(</span><em>self</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#EngFormatter.get_usetex"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.EngFormatter.get_usetex" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">set_useMathText</code><spanclass="sig-paren">(</span><em>self</em>, <em>val</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/ticker.html#EngFormatter.set_useMathText"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.ticker.EngFormatter.set_useMathText" title="Permalink to this definition">¶</a></dt>