<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/figure/writing_a_backend_pyplot_interface.html">Writing a backend -- the pyplot interface</a></li>
</ul>
</details></li>
</ul>
<ulclass="nav bd-sidenav">
<liclass="toctree-l1 has-children"><aclass="reference internal" href="../users/explain/axes/index.html">Axes and subplots</a><details><summary><spanclass="toctree-toggle" role="presentation"><iclass="fa-solid fa-chevron-down"></i></span></summary><ul>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/axes/axes_intro.html">Introduction to Axes (or Subplots)</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/axes/arranging_axes.html">Arranging multiple Axes in a Figure</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/artists/imshow_extent.html">Understanding the extent keyword argument of imshow</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../users/explain/customizing.html">Customizing Matplotlib with style sheets and rcParams</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/text/pgf.html">Text rendering with XeLaTeX/LuaLaTeX via the <codeclass="docutils literal notranslate"><spanclass="pre">pgf</span></code> backend</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/text/usetex.html">Text rendering with LaTeX</a></li>
</ul>
</details></li>
</ul>
<ulclass="nav bd-sidenav">
<liclass="toctree-l1 has-children"><aclass="reference internal" href="../users/explain/animations/index.html">Animations using Matplotlib</a><details><summary><spanclass="toctree-toggle" role="presentation"><iclass="fa-solid fa-chevron-down"></i></span></summary><ul>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/animations/animations.html">Animations using Matplotlib</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="../users/explain/animations/blitting.html">Faster rendering by using blitting</a></li>
<liclass="toctree-l1 current active has-children"><aclass="reference internal" href="index.html">Installation</a><detailsopen="open"><summary><spanclass="toctree-toggle" role="presentation"><iclass="fa-solid fa-chevron-down"></i></span></summary><ulclass="current">
<spanid="id1"></span><h1>Dependencies<aclass="headerlink" href="#dependencies" title="Link to this heading">#</a></h1>
<sectionid="runtime-dependencies">
<spanid="id2"></span><h2>Runtime dependencies<aclass="headerlink" href="#runtime-dependencies" title="Link to this heading">#</a></h2>
<sectionid="required">
<h3>Required<aclass="headerlink" href="#required" title="Link to this heading">#</a></h3>
<p>When installing through a package manager like <codeclass="docutils literal notranslate"><spanclass="pre">pip</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">conda</span></code>, the
mandatory dependencies are automatically installed. This list is mainly for
(>= 3.2.0; only required on Python < 3.10)</p></li>
</ul>
</section>
<sectionid="optional">
<spanid="optional-dependencies"></span><h3>Optional<aclass="headerlink" href="#optional" title="Link to this heading">#</a></h3>
<p>The following packages and tools are not required but extend the capabilities
of Matplotlib.</p>
<sectionid="backends">
<spanid="backend-dependencies"></span><h4>Backends<aclass="headerlink" href="#backends" title="Link to this heading">#</a></h4>
<p>Matplotlib figures can be rendered to various user interfaces. See
<aclass="reference internal" href="../users/explain/figure/backends.html#what-is-a-backend"><spanclass="std std-ref">What is a backend?</span></a> for more details on the optional Matplotlib backends
and the capabilities they provide.</p>
<ulclass="simple">
<li><p><aclass="reference external" href="https://docs.python.org/3/library/tk.html">Tk</a> (>= 8.5, != 8.6.0 or 8.6.1): for the Tk-based backends. Tk is part of
most standard Python installations, but it's not part of Python itself and
thus may not be present in rare cases.</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/PyQt6/">PyQt6</a> (>= 6.1), <aclass="reference external" href="https://pypi.org/project/PySide6/">PySide6</a>, <aclass="reference external" href="https://pypi.org/project/PyQt5/">PyQt5</a> (>= 5.12), or <aclass="reference external" href="https://pypi.org/project/PySide2/">PySide2</a>: for the Qt-based
backends.</p></li>
<li><p><aclass="reference external" href="https://pygobject.readthedocs.io/en/latest/">PyGObject</a> and <aclass="reference external" href="https://pycairo.readthedocs.io/en/latest/">pycairo</a> (>= 1.14.0): for the GTK-based backends. If using pip
(but not conda or system package manager) PyGObject must be built from
source; see <aclass="reference external" href="https://pygobject.readthedocs.io/en/latest/devguide/dev_environ.html">pygobject documentation</a>.</p></li>
<li><p><aclass="reference external" href="https://pycairo.readthedocs.io/en/latest/">pycairo</a> (>= 1.14.0) or <aclass="reference external" href="https://doc.courtbouillon.org/cairocffi/stable/">cairocffi</a> (>= 0.8): for cairo-based backends.</p></li>
<li><p><aclass="reference external" href="https://www.wxpython.org/">wxPython</a> (>= 4): for the wx-based backends. If using pip (but not conda or
system package manager) on Linux wxPython wheels must be manually downloaded
from <aclass="reference external" href="https://wxpython.org/pages/downloads/">https://wxpython.org/pages/downloads/</a>.</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/tornado/">Tornado</a> (>= 5): for the WebAgg backend.</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/ipykernel/">ipykernel</a>: for the nbagg backend.</p></li>
<li><p>macOS (>= 10.12): for the macosx backend.</p></li>
</ul>
</section>
<sectionid="animations">
<h4>Animations<aclass="headerlink" href="#animations" title="Link to this heading">#</a></h4>
<ulclass="simple">
<li><p><aclass="reference external" href="https://www.ffmpeg.org/">ffmpeg</a>: for saving movies.</p></li>
<li><p><aclass="reference external" href="https://www.imagemagick.org/script/index.php">ImageMagick</a>: for saving
animated gifs.</p></li>
</ul>
</section>
<sectionid="font-handling-and-rendering">
<h4>Font handling and rendering<aclass="headerlink" href="#font-handling-and-rendering" title="Link to this heading">#</a></h4>
<ulclass="simple">
<li><p><aclass="reference external" href="https://www.latex-project.org/">LaTeX</a> (with <aclass="reference external" href="https://ctan.org/pkg/cm-super">cm-super</a> and <aclass="reference external" href="https://ctan.org/pkg/underscore">underscore</a>) and <aclass="reference external" href="https://ghostscript.com/releases/">GhostScript (>= 9.0)</a>: for rendering text with LaTeX.</p></li>
<li><p><aclass="reference external" href="https://www.fontconfig.org">fontconfig</a> (>= 2.7): for detection of system
fonts on Linux.</p></li>
</ul>
</section>
</section>
<sectionid="c-libraries">
<h3>C libraries<aclass="headerlink" href="#c-libraries" title="Link to this heading">#</a></h3>
<p>Matplotlib brings its own copies of the following libraries:</p>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Agg</span></code>: the Anti-Grain Geometry C++ rendering engine</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">ttconv</span></code>: a TrueType font utility</p></li>
</ul>
<p>Additionally, Matplotlib depends on:</p>
<ulclass="simple">
<li><p><aclass="reference external" href="https://www.freetype.org/">FreeType</a> (>= 2.3): a font rendering library</p></li>
<li><p><aclass="reference external" href="http://www.qhull.org/">QHull</a> (>= 8.0.2): a library for computing triangulations (note that this version is
also known as 2020.2)</p></li>
</ul>
<sectionid="download-during-install">
<h4>Download during install<aclass="headerlink" href="#download-during-install" title="Link to this heading">#</a></h4>
<p>By default, Matplotlib downloads and builds its own copies of Qhull and FreeType.
The vendored version of FreeType is necessary to run the test suite, because
different versions of FreeType rasterize characters differently.</p>
</section>
<sectionid="use-system-libraries">
<h4>Use system libraries<aclass="headerlink" href="#use-system-libraries" title="Link to this heading">#</a></h4>
<p>To force Matplotlib to use a copy of FreeType or Qhull already installed in your system,
you must <aclass="reference external" href="https://meson-python.readthedocs.io/en/stable/how-to-guides/config-settings.html">pass configuration settings to Meson via meson-python</a>:</p>
brew<spanclass="w"></span>install<spanclass="w"></span>freetype<spanclass="w"></span><spanclass="c1"># macOS with Homebrew</span>
conda<spanclass="w"></span>install<spanclass="w"></span>freetype<spanclass="w"></span><spanclass="c1"># conda, any OS</span>
</pre></div>
</div>
<p>(adapt accordingly for Qhull).</p>
<p>On Linux and macOS, it is also recommended to install <aclass="reference external" href="https://www.freedesktop.org/wiki/Software/pkg-config/">pkg-config</a>, a helper
tool for locating FreeType:</p>
<divclass="highlight-sh notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># Pick ONE of the following:</span>
<h4>From source files<aclass="headerlink" href="#from-source-files" title="Link to this heading">#</a></h4>
<p>If the automatic download does not work (for example, on air-gapped systems) it is
preferable to instead use system libraries. However you can manually download the
tarballs into <codeclass="file docutils literal notranslate"><spanclass="pre">subprojects/packagecache</span></code> at the top level of the checkout
repository. The expected SHA256 hashes of the downloaded tarballs are in
<codeclass="file docutils literal notranslate"><spanclass="pre">subprojects/*.wrap</span></code> if you wish to verify them, but they will also be checked by
the build system before unpacking.</p>
</section>
</section>
<sectionid="minimum-pip-manylinux-support-linux">
<h3>Minimum pip / manylinux support (linux)<aclass="headerlink" href="#minimum-pip-manylinux-support-linux" title="Link to this heading">#</a></h3>
<p>In all cases the required version of pip is embedded in the CPython source.</p>
</section>
</section>
<sectionid="build-dependencies">
<spanid="development-dependencies"></span><h2>Build dependencies<aclass="headerlink" href="#build-dependencies" title="Link to this heading">#</a></h2>
<sectionid="setup-dependencies">
<spanid="id3"></span><h3>Python<aclass="headerlink" href="#setup-dependencies" title="Link to this heading">#</a></h3>
<p>By default, <codeclass="docutils literal notranslate"><spanclass="pre">pip</span></code> will build packages using build isolation, meaning that these
build dependencies are temporally installed by pip for the duration of the
Matplotlib build process. However, build isolation is disabled when <aclass="reference internal" href="../devel/development_setup.html#development-install"><spanclass="std std-ref">installing Matplotlib for development</span></a>;
therefore we recommend using one of our <aclass="reference internal" href="../devel/development_setup.html#dev-environment"><spanclass="std std-ref">virtual environment configurations</span></a> to
create a development environment in which these packages are automatically installed.</p>
<p>If you are developing Matplotlib and unable to use our environment configurations,
then you must manually install the following packages into your development environment:</p>
<p>On some Linux systems, you can install a meta-build package. For example,
on Ubuntu <codeclass="docutils literal notranslate"><spanclass="pre">apt</span><spanclass="pre">install</span><spanclass="pre">build-essential</span></code></p>
<p>Otherwise, use the system distribution's package manager to install
<li><p><aclass="reference external" href="https://pypi.org/project/nbformat/">nbformat</a> and <aclass="reference external" href="https://pypi.org/project/nbconvert/">nbconvert</a> used to test the notebook backend</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pandas/">pandas</a> used to test compatibility with Pandas</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pikepdf/">pikepdf</a> used in some tests for the pgf and pdf backends</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/psutil/">psutil</a> used in testing the interactive backends</p></li>
<li><p><aclass="reference external" href="https://pytest-cov.readthedocs.io/en/latest/">pytest-cov</a> (>= 2.3.1) to collect coverage information</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-flake8/">pytest-flake8</a> to test coding standards using <aclass="reference external" href="https://pypi.org/project/flake8/">flake8</a></p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-timeout/">pytest-timeout</a> to limit runtime in case of stuck tests</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-xdist/">pytest-xdist</a> to run tests in parallel</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/pytest-xvfb/">pytest-xvfb</a> to run tests without windows popping up (Linux)</p></li>
<li><p><aclass="reference external" href="https://fonts.google.com/noto/use#faq">pytz</a> used to test pytz int</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/Sphinx/">sphinx</a> used to test our sphinx extensions</p></li>
<li><p><aclass="reference external" href="http://wenq.org/en/">WenQuanYi Zen Hei</a> and <aclass="reference external" href="https://fonts.google.com/noto/use">Noto Sans CJK</a> fonts for testing font fallback and
non-Western fonts</p></li>
<li><p><aclass="reference external" href="https://pypi.org/project/xarray/">xarray</a> used to test compatibility with xarray</p></li>
</ul>
<p>If any of these dependencies are not discovered, then the tests that rely on
them will be skipped by pytest.</p>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>When installing Inkscape on Windows, make sure that you select “Add
Inkscape to system PATH”, either for all users or current user, or the
tests will not find it.</p>
</div>
</section>
</section>
<sectionid="documentation-dependencies">
<spanid="doc-dependencies"></span><h2>Documentation dependencies<aclass="headerlink" href="#documentation-dependencies" title="Link to this heading">#</a></h2>
<sectionid="id8">
<h3>Python<aclass="headerlink" href="#id8" title="Link to this heading">#</a></h3>
<p>The additional Python packages required to build the
<aclass="reference internal" href="../devel/document.html#documenting-matplotlib"><spanclass="std std-ref">documentation</span></a> are listed in
<codeclass="file docutils literal notranslate"><spanclass="pre">doc-requirements.txt</span></code> and can be installed using</p>