Ubuntu 11.10 Oneiric has the package python-matplotlib that supports Python 2. Below are the steps I followed to install matplotlib for Python 3 from the latest sources. First numpy is installed for Python 3, which is a requirement for matplotlib. The –user option used below is for installing under .local/ in the home directory, so you don’t have to be root.
cd downloads
git clone git://github.com/numpy/numpy.git numpy
cd numpy/
python3 setup.py install --user
cd ..
git clone https://github.com/matplotlib/matplotlib
cd matplotlib/
python3 setup.py install --user
Both install commands take some minutes to complete while sources are compiled, be patient. To test the install, you may try these two commands, they should execute without errors:
python3 -c 'import numpy'
python3 -c 'import matplotlib'