Matplotlib Guide PDF
Matplotlib Guide PDF
John Hunter Excellence in Plotting Contest 2020 submissions are open! Entries are due June 1, 2020.
Version 3.2.1
Fork me on GitHub
Search
Installing
Note ◾ Installing an official release
◾ Test data
If you wish to contribute to the project, it's recommended you install
the latest development version. ◾ Third-party distributions of
Matplotlib
◾ Scientific Python
Contents Distributions
◾ Linux: using your package
◾ Installing manager
◾ Installing an official release ◾ Installing from source
◾ Test data
◾ Dependencies
◾ Third-party distributions of Matplotlib
◾ Building on Linux
◾ Scientific Python Distributions ◾ Building on macOS
◾ Linux: using your package manager ◾ Building on Windows
◾ Installing from source ◾ Wheel builds using conda
◾ Dependencies packages
◾ Building on Linux ◾ Conda packages
◾ Building on macOS
◾ Building on Windows
◾ Wheel builds using conda packages Documentation overview
◾ Conda packages ◾ User's Guide
◾ Previous: User's Guide
◾ Next: Tutorials
Matplotlib and its dependencies are available as wheel packages for Show Page Source
macOS, Windows and Linux distributions:
Note
The following backends work out of the box: Agg, ps, pdf, svg and
TkAgg.
The wheels (*.whl) on the PyPI download page do not contain test data
or example code.
If you want to try the many demos that come in the Matplotlib source
distribution, download the *.tar.gz file and look in the examples
subdirectory.
Anaconda and Canopy and ActiveState are excellent choices that "just
work" out of the box for Windows, macOS and common Linux platforms.
WinPython is an option for Windows users. All of these distributions
include Matplotlib and lots of other useful (data) science tools.
If you are on Linux, you might prefer to use your package manager.
Matplotlib is packaged for almost every major Linux distribution.
export CC=x86_64-pc-linux-gnu-gcc
export CXX=x86_64-pc-linux-gnu-g++
export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config
Once you have satisfied the requirements detailed below (mainly Python,
NumPy, libpng and FreeType), you can build Matplotlib.
cd matplotlib
python -mpip install .
We provide a setup.cfg file which you can use to customize the build
process. For example, which default backend to use, whether some of the
optional libraries that Matplotlib ships with are installed, and so on. This
file will be particularly useful to those packaging Matplotlib.
Note
Matplotlib depends on non-Python libraries.
and on Windows:
where ... means "also give, in the same format, the directories
containing png.h and zlib.h for the include path, and for
libpng.so/png.lib and libz.so/z.lib for the link path."
Note
The following libraries are shipped with Matplotlib:
If you are on Debian/Ubuntu, you can get all the dependencies required to
build Matplotlib with:
If you are on RedHat, you can get all the dependencies required to build
Matplotlib by first installing yum-builddep and then running:
su -c "yum-builddep python-matplotlib"
These commands do not build Matplotlib, but instead get and install the
build dependencies, which will make building from source easier.
If you are building your own Matplotlib wheels (or sdists), note that any
DLLs that you copy into the source tree will be packaged too.
This is a wheel build, but we use conda packages to get all the
requirements. The binary requirements (png, FreeType,...) are statically
linked and therefore not needed during the wheel install.
Set up the conda environment. Note, if you want a qt backend, add pyqt
to the list of conda packages.
conda create -n "matplotlib_build" python=3.7 numpy python-dateutil pyparsing tornado cycler tk libpng zlib freet
conda activate matplotlib_build
# force the build against static libpng and zlib libraries
set MPLSTATICBUILD=True
python setup.py bdist_wheel
© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2018 The
Matplotlib development team.
Last updated on Mar 19, 2020. Created using Sphinx 2.2.2. Doc version v3.2.1-6-g9a2f0578f.