Articles

Matplotlib 1.0.1 in Ubuntu 10.04

In howto on May 2, 2012 by theoryl Tagged: , , ,

Matplotlib is a plotting utility written in Python that has similar functions to those in Matlab. When trying to follow the tutorial, this line will give some error:

ax = fig.add_subplot(111, projection='3d'

if you installed Matplotlib from the repository (package named python-matplotlib). The ‘3d’ projection was added in Matplotlib version 1.0.0, but the Ubuntu 10.04 repository only has version 0.99. Let’s try to build from source then. First, download the needed version from sourceforge.net area. Then get the python development package:

sudo apt-get install python-all-dev

Remove Matplotlib from your system if it was installed. Untar the downloaded source files and cd to the directory. Create a file named matplotlibrc:

backend : WXAgg
interactive : True

to select the backend and enable the interactive mode. Why? Now proceed to build and install:

python setup.py build
sudo python setup.py install

Check if your system now has the updated version by doing:

python -c "import matplotlib; print matplotlib.__version__;"

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: