<divid="unreleased-message"> You are reading an old version of the documentation (v3.3.3). For the latest version see <ahref="https://matplotlib.org/stable/api/style_api.html">https://matplotlib.org/stable/api/style_api.html</a></div>
<h1><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.style</span></code><aclass="headerlink" href="#matplotlib-style" title="Permalink to this headline">¶</a></h1>
<p>Styles are predefined sets of <aclass="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> that define the visual appearance of
a plot.</p>
<p><aclass="reference internal" href="../tutorials/introductory/customizing.html"><spanclass="doc">Customizing Matplotlib with style sheets and rcParams</span></a> describes the mechanism and usage
of styles.</p>
<p>The <aclass="reference internal" href="../gallery/style_sheets/style_sheets_reference.html"><spanclass="doc">Style sheets reference</span></a> gives an overview of
<codeclass="descclassname">matplotlib.style.</code><codeclass="descname">context</code><spanclass="sig-paren">(</span><em><spanclass="n">style</span></em>, <em><spanclass="n">after_reset</span><spanclass="o">=</span><spanclass="default_value">False</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/style/core.html#context"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.style.context" title="Permalink to this definition">¶</a></dt>
<dd><p>Context manager for using style settings temporarily.</p>
<td>A path-like object which is a path to a style file.</td>
</tr>
<trclass="row-even"><td>list</td>
<td>A list of style specifiers (str, Path or dict) applied from
first to last in the list.</td>
</tr>
</tbody>
</table>
</dd>
<dt><strong>after_reset</strong><spanclass="classifier">bool</span></dt><dd><p>If True, apply style after resetting settings to their defaults;
otherwise, apply style on top of the current settings.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.style.reload_library">
<codeclass="descclassname">matplotlib.style.</code><codeclass="descname">reload_library</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/style/core.html#reload_library"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.style.reload_library" title="Permalink to this definition">¶</a></dt>
<dd><p>Reload the style library.</p>
</dd></dl>
<dlclass="py function">
<dtid="matplotlib.style.use">
<codeclass="descclassname">matplotlib.style.</code><codeclass="descname">use</code><spanclass="sig-paren">(</span><em><spanclass="n">style</span></em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/style/core.html#use"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.style.use" title="Permalink to this definition">¶</a></dt>
<dd><p>Use Matplotlib style settings from a style specification.</p>
<p>The style name of 'default' is reserved for reverting back to
the default style settings.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">This updates the <aclass="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> with the settings from the style.
<aclass="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">rcParams</span></code></a> not defined in the style are kept.</p>
<codeclass="descclassname">matplotlib.style.</code><codeclass="descname">library</code><aclass="headerlink" href="#matplotlib.style.matplotlib.style.library" title="Permalink to this definition">¶</a></dt>
<dd><p>A dict mapping from style name to <aclass="reference internal" href="matplotlib_configuration_api.html#matplotlib.RcParams" title="matplotlib.RcParams"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">RcParams</span></code></a> defining that style.</p>
<p>This is meant to be read-only. Use <aclass="reference internal" href="#matplotlib.style.reload_library" title="matplotlib.style.reload_library"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">reload_library</span></code></a> to update.</p>
<codeclass="descclassname">matplotlib.style.</code><codeclass="descname">available</code><aclass="headerlink" href="#matplotlib.style.matplotlib.style.available" title="Permalink to this definition">¶</a></dt>
<dd><p>List of the names of the available styles.</p>
<p>This is meant to be read-only. Use <aclass="reference internal" href="#matplotlib.style.reload_library" title="matplotlib.style.reload_library"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">reload_library</span></code></a> to update.</p>