OK, so you want to do it the hard way?
There are lots of different ways to install matplotlib, and the best way depends on what operating system you are using, what you already have installed, and how you want to use it. To avoid wading through all the details (and potential complications) on this page, the easiest thing for you to do is use one of the pre-packaged python distributions that already provide matplotlib built in. The Enthought Python Distribution (EPD) for Windows, OS X or Redhat is an excellent choice that “just works” out of the box. Another excellent alternative for Windows users is Python (x, y) which tends to be updated a bit more frequently. Both of these packages include matplotlib and pylab, and lots of other useful tools. matplotlib is also packaged for pretty much every major linux distribution, so if you are on linux your package manager will probably provide matplotlib prebuilt.
One single click installer and you are done.
matplotlib requires numpy version 1.1 or later. Although it is not a requirement to use matplotlib, we strongly encourage you to install ipython, which is an interactive shell for python that is matplotlib aware.
Instructions for installing our OSX binaries are found in the FAQ ref: install_osx_binaries .
If you are interested perhaps in contributing to matplotlib development, running the latest greatest code, or just like to build everything yourself, it is not difficult to build matplotlib from source. Grab the latest tar.gz release file from sourceforge, or if you want to develop matplotlib or just need the latest bugfixed version, grab the latest svn version Install from svn.
We provide a setup.cfg file that lives along setup.py 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.
These are external packages which you will need to install before installing matplotlib. Windows users only need the first two (python and numpy) since the others are built into the matplotlib windows installers available for download at the sourceforge site. If you are building on OSX, see Building on OSX. If you are installing dependencies with a package manager, you may need to install the development packages (look for a “-dev” postfix) in addition to the libraries themselves.
timezone handling for python datetime objects. By default, matplotlib will install pytz if it isn’t already installed on your system. To override the default, use :file:`setup.cfg to force or prevent installation of pytz.
The build situation on OSX is complicated by the various places one can get the png and freetype requirements from (darwinports, fink, /usr/X11R6) and the different architectures (x86, ppc, universal) and the different OSX version (10.4 and 10.5). We recommend that you build the way we do for the OSX release: by grabbing the tarbar or svn repository, cd-ing into the release/osx dir, and following the instruction in the README. This directory has a Makefile which will automatically grab the zlib, png and freetype dependencies from the web, build them with the right flags to make universal libraries, and then build the matplotlib source and binary installers.