Matplotlib releases are available as wheel packages for macOS, Windows and
Linux on PyPI. Install it using
pip
:
python -m pip install -U pip
python -m pip install -U matplotlib
If this command results in Matplotlib being compiled from source and
there's trouble with the compilation, you can add --prefer-binary
to
select the newest version of Matplotlib for which there is a
precompiled wheel for your OS and Python.
Note
The following backends work out of the box: Agg, ps, pdf, svg
Python is typically shipped with tk bindings which are used by TkAgg.
For support of other GUI frameworks, LaTeX rendering, saving animations and a larger selection of file formats, you can install :ref:`optional_dependencies`.
Various third-parties provide Matplotlib for their environments.
Matplotlib is available both via the anaconda main channel
conda install matplotlib
as well as via the conda-forge community channel
conda install -c conda-forge matplotlib
Matplotlib is part of major Python distributions:
If you are using the Python version that comes with your Linux distribution, you can install Matplotlib via your package manager, e.g.:
- Debian / Ubuntu:
sudo apt-get install python3-matplotlib
- Fedora:
sudo dnf install python3-matplotlib
- Red Hat:
sudo yum install python3-matplotlib
- Arch:
sudo pacman -S python-matplotlib
See :ref:`install_from_source`.
See :ref:`installing_for_devs`.