<h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib</span></code><aclass="headerlink" href="#matplotlib" title="Permalink to this headline">¶</a></h1>
<divclass="section" id="backend-management">
<h2>Backend management<aclass="headerlink" href="#backend-management" title="Permalink to this headline">¶</a></h2>
<dlclass="py function">
<dtid="matplotlib.use">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">use</code><spanclass="sig-paren">(</span><em><spanclass="n">backend</span></em>, <em><spanclass="o">*</span></em>, <em><spanclass="n">force</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#use"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.use" title="Permalink to this definition">¶</a></dt>
<dd><p>Select the backend used for rendering and GUI integration.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>backend</strong><spanclass="classifier">str</span></dt><dd><p>The backend to switch to. This can either be one of the standard
backend names, which are case-insensitive:</p>
<ulclass="simple">
<li>interactive backends:
GTK3Agg, GTK3Cairo, MacOSX, nbAgg,
Qt4Agg, Qt4Cairo, Qt5Agg, Qt5Cairo,
TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo</li>
<li>non-interactive backends:
agg, cairo, pdf, pgf, ps, svg, template</li>
</ul>
<p>or a string of the form: <codeclass="docutils literal notranslate"><spanclass="pre">module://my.module.name</span></code>.</p>
</dd>
<dt><strong>force</strong><spanclass="classifier">bool, default: True</span></dt><dd><p>If True (the default), raise an <aclass="reference external" href="https://docs.python.org/3/library/exceptions.html#ImportError" title="(in Python v3.9)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ImportError</span></code></a> if the backend cannot be
set up (either because it fails to import, or because an incompatible
GUI interactive framework is already running); if False, ignore the
<codeclass="descclassname">matplotlib.</code><codeclass="descname">get_backend</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#get_backend"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.get_backend" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the name of the current backend.</p>
<codeclass="descclassname">matplotlib.</code><codeclass="descname">interactive</code><spanclass="sig-paren">(</span><em><spanclass="n">b</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#interactive"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.interactive" title="Permalink to this definition">¶</a></dt>
<dd><p>Set whether to redraw after every plotting command (e.g. <aclass="reference internal" href="_as_gen/matplotlib.pyplot.xlabel.html#matplotlib.pyplot.xlabel" title="matplotlib.pyplot.xlabel"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">pyplot.xlabel</span></code></a>).</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.is_interactive">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">is_interactive</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#is_interactive"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.is_interactive" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether to redraw after every plotting command.</p>
<h2>Default values and styling<aclass="headerlink" href="#default-values-and-styling" title="Permalink to this headline">¶</a></h2>
<dlclass="py data">
<dtid="matplotlib.rcParams">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rcParams</code><aclass="headerlink" href="#matplotlib.rcParams" title="Permalink to this definition">¶</a></dt>
<dd><p>An instance of <aclass="reference internal" href="#matplotlib.RcParams" title="matplotlib.RcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">RcParams</span></code></a> for handling default Matplotlib values.</p>
</dd></dl>
<dlclass="py class">
<dtid="matplotlib.RcParams">
<emclass="property">class </em><codeclass="descclassname">matplotlib.</code><codeclass="descname">RcParams</code><spanclass="sig-paren">(</span><em><spanclass="o">*</span><spanclass="n">args</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#RcParams"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.RcParams" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary object including validation.</p>
<p>Validating functions are defined and associated with rc parameters in
<codeclass="descname">find_all</code><spanclass="sig-paren">(</span><em><spanclass="n">self</span></em>, <em><spanclass="n">pattern</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#RcParams.find_all"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.RcParams.find_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the subset of this RcParams dictionary whose keys match,
using <aclass="reference external" href="https://docs.python.org/3/library/re.html#re.search" title="(in Python v3.9)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">re.search()</span></code></a>, the given <codeclass="docutils literal notranslate"><spanclass="pre">pattern</span></code>.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">Changes to the returned dictionary are <em>not</em> propagated to
the parent RcParams dictionary.</p>
</div>
</dd></dl>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.rc_context">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rc_context</code><spanclass="sig-paren">(</span><em><spanclass="n">rc</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <em><spanclass="n">fname</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rc_context"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rc_context" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a context manager for temporarily changing rcParams.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>rc</strong><spanclass="classifier">dict</span></dt><dd><p>The rcParams to temporarily set.</p>
</dd>
<dt><strong>fname</strong><spanclass="classifier">str or path-like</span></dt><dd><p>A file with Matplotlib rc settings. If both <em>fname</em> and <em>rc</em> are given,
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rc</code><spanclass="sig-paren">(</span><em><spanclass="n">group</span></em>, <em><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rc"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rc" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the current <aclass="reference internal" href="#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a>. <em>group</em> is the grouping for the rc, e.g.,
for <codeclass="docutils literal notranslate"><spanclass="pre">lines.linewidth</span></code> the group is <codeclass="docutils literal notranslate"><spanclass="pre">lines</span></code>, for
<codeclass="docutils literal notranslate"><spanclass="pre">axes.facecolor</span></code>, the group is <codeclass="docutils literal notranslate"><spanclass="pre">axes</span></code>, and so on. Group may
also be a list or tuple of group names, e.g., (<em>xtick</em>, <em>ytick</em>).
<em>kwargs</em> is a dictionary attribute name/value pairs, e.g.,:</p>
<p>sets the current <aclass="reference internal" href="#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> and is equivalent to:</p>
<spanclass="n">rc</span><spanclass="p">(</span><spanclass="s1">'font'</span><spanclass="p">,</span><spanclass="o">**</span><spanclass="n">font</span><spanclass="p">)</span><spanclass="c1"># pass in the font dict as kwargs</span>
</pre></div>
</div>
<p>This enables you to easily switch between several configurations. Use
<codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.style.use('default')</span></code> or <aclass="reference internal" href="#matplotlib.rcdefaults" title="matplotlib.rcdefaults"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">rcdefaults()</span></code></a> to
restore the default <aclass="reference internal" href="#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> after changes.</p>
<pclass="rubric">Notes</p>
<p>Similar functionality is available by using the normal dict interface, i.e.
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rcdefaults</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rcdefaults"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rcdefaults" title="Permalink to this definition">¶</a></dt>
<dd><p>Restore the <aclass="reference internal" href="#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> from Matplotlib's internal default style.</p>
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.style.core.STYLE_BLACKLIST</span></code>) are not updated.</p>
<divclass="admonition seealso">
<pclass="first admonition-title">See also</p>
<dlclass="last docutils">
<dt><aclass="reference internal" href="#matplotlib.rc_file_defaults" title="matplotlib.rc_file_defaults"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.rc_file_defaults</span></code></a></dt><dd>Restore the <aclass="reference internal" href="#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> from the rc file originally loaded by Matplotlib.</dd>
<dt><aclass="reference internal" href="style_api.html#matplotlib.style.use" title="matplotlib.style.use"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.style.use</span></code></a></dt><dd>Use a specific style file. Call <codeclass="docutils literal notranslate"><spanclass="pre">style.use('default')</span></code> to restore the default style.</dd>
</dl>
</div>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.rc_file_defaults">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rc_file_defaults</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rc_file_defaults"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rc_file_defaults" title="Permalink to this definition">¶</a></dt>
<dd><p>Restore the <aclass="reference internal" href="#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> from the original rc file loaded by Matplotlib.</p>
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.style.core.STYLE_BLACKLIST</span></code>) are not updated.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.rc_file">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rc_file</code><spanclass="sig-paren">(</span><em><spanclass="n">fname</span></em>, <em><spanclass="o">*</span></em>, <em><spanclass="n">use_default_template</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rc_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rc_file" 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>fname</strong><spanclass="classifier">str or path-like</span></dt><dd><p>A file with Matplotlib rc settings.</p>
</dd>
<dt><strong>use_default_template</strong><spanclass="classifier">bool</span></dt><dd><p>If True, initialize with default parameters before updating with those
in the given file. If False, the current configuration persists
and only the parameters specified in the file are updated.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.rc_params">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rc_params</code><spanclass="sig-paren">(</span><em><spanclass="n">fail_on_error</span><spanclass="o">=</span><spanclass="default_value">False</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rc_params"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rc_params" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a <aclass="reference internal" href="#matplotlib.RcParams" title="matplotlib.RcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">RcParams</span></code></a> instance from the default Matplotlib rc file.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.rc_params_from_file">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">rc_params_from_file</code><spanclass="sig-paren">(</span><em><spanclass="n">fname</span></em>, <em><spanclass="n">fail_on_error</span><spanclass="o">=</span><spanclass="default_value">False</span></em>, <em><spanclass="n">use_default_template</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#rc_params_from_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.rc_params_from_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a <aclass="reference internal" href="#matplotlib.RcParams" title="matplotlib.RcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">RcParams</span></code></a> from file <em>fname</em>.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>fname</strong><spanclass="classifier">str or path-like</span></dt><dd><p>A file with Matplotlib rc settings.</p>
</dd>
<dt><strong>fail_on_error</strong><spanclass="classifier">bool</span></dt><dd><p>If True, raise an error when the parser fails to convert a parameter.</p>
</dd>
<dt><strong>use_default_template</strong><spanclass="classifier">bool</span></dt><dd><p>If True, initialize with default parameters before updating with those
in the given file. If False, the configuration class only contains the
parameters specified in the file. (Useful for updating dicts.)</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.get_configdir">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">get_configdir</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#get_configdir"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.get_configdir" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string path of the the configuration directory.</p>
<p>The directory is chosen as follows:</p>
<olclass="arabic simple">
<li>If the MPLCONFIGDIR environment variable is supplied, choose that.</li>
<li>On Linux, follow the XDG specification and look first in
<codeclass="docutils literal notranslate"><spanclass="pre">$XDG_CONFIG_HOME</span></code>, if defined, or <codeclass="docutils literal notranslate"><spanclass="pre">$HOME/.config</span></code>. On other
<li>If the chosen directory exists and is writable, use that as the
configuration directory.</li>
<li>Else, create a temporary directory, and use it as the configuration
directory.</li>
</ol>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.matplotlib_fname">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">matplotlib_fname</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#matplotlib_fname"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.matplotlib_fname" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the location of the config file.</p>
<p>The file location is determined in the following order</p>
- <codeclass="docutils literal notranslate"><spanclass="pre">$HOME/.matplotlib/matplotlibrc</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">$HOME</span></code> is defined</li>
<li>Lastly, it looks in <codeclass="docutils literal notranslate"><spanclass="pre">$MATPLOTLIBDATA/matplotlibrc</span></code>, which should always
exist.</li>
</ul>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.get_data_path">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">get_data_path</code><spanclass="sig-paren">(</span><em><spanclass="o">*</span></em>, <em><spanclass="n">_from_rc</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#get_data_path"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.get_data_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the path to Matplotlib data.</p>
</dd></dl>
</div>
<divclass="section" id="logging">
<h2>Logging<aclass="headerlink" href="#logging" title="Permalink to this headline">¶</a></h2>
<dlclass="py function">
<dtid="matplotlib.set_loglevel">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">set_loglevel</code><spanclass="sig-paren">(</span><em><spanclass="n">level</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#set_loglevel"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.set_loglevel" title="Permalink to this definition">¶</a></dt>
<dd><p>Set Matplotlib's root logger and root logger handler level, creating
the handler if it does not exist yet.</p>
<p>Typically, one should call <codeclass="docutils literal notranslate"><spanclass="pre">set_loglevel("info")</span></code> or
<codeclass="docutils literal notranslate"><spanclass="pre">set_loglevel("debug")</span></code> to get additional debugging information.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>level</strong><spanclass="classifier">{"notset", "debug", "info", "warning", "error", "critical"}</span></dt><dd><p>The log level of the handler.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Notes</p>
<p>The first time this function is called, an additional handler is attached
to Matplotlib's root handler; this handler is reused every time and this
function simply manipulates the logger and handler's level.</p>
</dd></dl>
</div>
<divclass="section" id="miscellaneous">
<h2>Miscellaneous<aclass="headerlink" href="#miscellaneous" title="Permalink to this headline">¶</a></h2>
<dlclass="py function">
<dtid="matplotlib.get_cachedir">
<codeclass="descclassname">matplotlib.</code><codeclass="descname">get_cachedir</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib.html#get_cachedir"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.get_cachedir" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string path of the cache directory.</p>
<p>The procedure used to find the directory is the same as for
_get_config_dir, except using <codeclass="docutils literal notranslate"><spanclass="pre">$XDG_CACHE_HOME</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">$HOME/.cache</span></code> instead.</p>