1- .. _ install_requirements :
1+ .. _ dependencies :
22
33============
44Dependencies
55============
66
7- Matplotlib will automatically install dependencies when you install with
8- `` pip ``, so this section is mostly for your reference.
7+ Mandatory dependencies
8+ ======================
99
10- Matplotlib requires the following dependencies:
10+ When installing through a package manager like ``pip `` or ``conda ``, the
11+ mandatory dependencies are automatically installed. This list is mainly for
12+ reference.
1113
1214* `Python <https://www.python.org/downloads/ >`_ (>= 3.7)
1315* `NumPy <https://numpy.org >`_ (>= 1.16)
@@ -18,11 +20,23 @@ Matplotlib requires the following dependencies:
1820* `Pillow <https://pillow.readthedocs.io/en/latest/ >`_ (>= 6.2)
1921* `pyparsing <https://pypi.org/project/pyparsing/ >`_ (>=2.2.1)
2022
21- Optionally, you can also install a number of packages to enable better user
22- interface toolkits. See :ref: `what-is-a-backend ` for more details on the
23- optional Matplotlib backends and the capabilities they provide.
2423
25- * Tk _ (>= 8.3, != 8.6.0 or 8.6.1): for the Tk-based backends.
24+ .. _optional_dependencies :
25+
26+ Optional dependencies
27+ =====================
28+
29+ The following packages and tools are not required but extend the capabilities
30+ of Matplotlib.
31+
32+ Backends
33+ --------
34+
35+ Matplotlib figures can be rendered to various user interfaces. See
36+ :ref: `what-is-a-backend ` for more details on the optional Matplotlib backends
37+ and the capabilities they provide.
38+
39+ * Tk _ (>= 8.3, != 8.6.0 or 8.6.1) [# ]_: for the Tk-based backends.
2640* PyQt4 _ (>= 4.6) or PySide _ (>= 1.0.3) [# ]_: for the Qt4-based backends.
2741* PyQt5 _ or PySide2 _: for the Qt5-based backends.
2842* PyGObject _: for the GTK3-based backends [# ]_.
@@ -42,38 +56,51 @@ optional Matplotlib backends and the capabilities they provide.
4256.. _cairocffi : https://cairocffi.readthedocs.io/en/latest/
4357.. _Tornado : https://pypi.org/project/tornado
4458
59+ .. [# ] Tk is part of most standard Python installations, but it's not part of
60+ Python itself and thus may not be present in rare cases.
4561 .. [# ] PySide cannot be pip-installed on Linux (but can be conda-installed).
4662 .. [# ] If using pip (and not conda), PyGObject must be built from source; see
4763 https://pygobject.readthedocs.io/en/latest/devguide/dev_environ.html.
4864 .. [# ] If using pip (and not conda) on Linux, wxPython wheels must be manually
4965 downloaded from https://wxpython.org/pages/downloads/.
5066
51- For better support of animation output format and image file formats, LaTeX,
52- etc., you can install the following:
67+ Animations
68+ ----------
5369
5470* `ffmpeg <https://www.ffmpeg.org/ >`_: for saving movies.
5571* `ImageMagick <https://www.imagemagick.org/script/index.php >`_: for saving
5672 animated gifs.
73+
74+ Font handling and rendering
75+ ---------------------------
76+
5777* `LaTeX <https://www.latex-project.org/ >`_ (with `cm-super
5878 <https://ctan.org/pkg/cm-super> `__ ) and `GhostScript (>=9.0)
59- <https://ghostscript.com/download/> `_ : for rendering text with
60- LaTeX.
79+ <https://ghostscript.com/download/> `_ : for rendering text with LaTeX.
6180* `fontconfig <https://www.fontconfig.org >`_ (>= 2.7): for detection of system
6281 fonts on Linux.
6382
64- FreeType and Qhull
65- ------------------
83+ C libraries
84+ ===========
6685
67- Matplotlib depends on FreeType _ (>= 2.3), a font rendering library, and on
68- Qhull _ (>= 2020.2), a library for computing triangulations. By default,
69- Matplotlib downloads and builds its own copies of FreeType (this is necessary
70- to run the test suite, because different versions of FreeType rasterize
71- characters differently) and of Qhull. As an exception, Matplotlib defaults to
72- the system version of FreeType on AIX.
86+ Matplotlib brings its own copies of the following libraries:
87+
88+ - ``Agg ``: the Anti-Grain Geometry C++ rendering engine
89+ - ``ttconv ``: a TrueType font utility
90+
91+ Additionally, Matplotlib depends on:
92+
93+ - FreeType _ (>= 2.3): a font rendering library
94+ - QHull _ (>= 2020.2): a library for computing triangulations
7395
7496.. _FreeType : https://www.freetype.org/
7597.. _Qhull : http://www.qhull.org/
7698
99+ By default, Matplotlib downloads and builds its own copies of FreeType (this is
100+ necessary to run the test suite, because different versions of FreeType
101+ rasterize characters differently) and of Qhull. As an exception, Matplotlib
102+ defaults to the system version of FreeType on AIX.
103+
77104To force Matplotlib to use a copy of FreeType or Qhull already installed in
78105your system, create a :file: `setup.cfg ` file with the following contents:
79106
@@ -92,9 +119,9 @@ This can be achieved using a package manager, e.g. for FreeType:
92119
93120 # Pick ONE of the following:
94121 sudo apt install libfreetype6-dev # Debian/Ubuntu
95- sudo dnf install freetype-devel # Fedora
96- brew install freetype # macOS with Homebrew
97- conda install freetype # conda, any OS
122+ sudo dnf install freetype-devel # Fedora
123+ brew install freetype # macOS with Homebrew
124+ conda install freetype # conda, any OS
98125
99126 (adapt accordingly for Qhull).
100127
@@ -105,9 +132,9 @@ tool for locating FreeType:
105132
106133 # Pick ONE of the following:
107134 sudo apt install pkg-config # Debian/Ubuntu
108- sudo dnf install pkgconf # Fedora
109- brew install pkg-config # macOS with Homebrew
110- conda install pkg-config # conda
135+ sudo dnf install pkgconf # Fedora
136+ brew install pkg-config # macOS with Homebrew
137+ conda install pkg-config # conda
111138 # Or point the PKG_CONFIG environment variable to the path to pkg-config:
112139 export PKG_CONFIG=...
113140
@@ -130,13 +157,6 @@ and on Windows:
130157 set CL = /IC:\directory\containing\ft2build.h
131158 set LINK = /LIBPATH:C:\directory\containing\freetype.lib
132159
133- .. note ::
134-
135- Matplotlib always uses its own copies of the following libraries:
136-
137- - ``Agg ``: the Anti-Grain Geometry C++ rendering engine;
138- - ``ttconv ``: a TrueType font utility.
139-
140160 If you go this route but need to reset and rebuild to change your settings,
141161remember to clear your artifacts before re-building::
142162
0 commit comments