matplotlib (all lowercase by convention) is a very useful Python plotting library, and we will need it for the following recipes as well as more later on. It depends on NumPy, but in all likelihood, you already have NumPy installed.
We will see how matplotlib can be installed on Windows, Linux, and Mac OS X, and also how to install it from source:
Installing matplotlib on Windows: You can install this with the Enthought distribution, also known as Canopy (http://www.enthought.com/products/epd.php).
It might be necessary to put the
msvcp71.dll
file in yourC:\Windows\system32
directory. You can get it from http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71.Installing matplotlib on Linux: Let's see how matplotlib can be installed in the various distributions of Linux:
Here is the install command on Debian and Ubuntu:
$ sudo apt-get install python-matplotlib
The install command on Fedora/Redhat is as follows:
$ su - yum install python-matplotlib
Installing from source: You can download the latest source from the
tar.gz
release at Sourceforge (http://sourceforge.net/projects/matplotlib/files/), or from the Git repository using the following command:$ git clone git://github.com/matplotlib/matplotlib.git
Once it has been downloaded, build and install matplotlib as usual with the following commands:
$ cd matplotlib $ sudo python setup.py install
Installing matplotlib on Mac OS X: Get the latest DMG file from http://sourceforge.net/projects/matplotlib/files/matplotlib/ and install it. You can also use the Mac Ports, Fink, or Homebrew package managers.
Instructions from the official matplotlib documentation are given at http://matplotlib.org/users/installing.html
Installing the SciPy stack is explained at http://www.scipy.org/install.html