using Ubuntu 12.04 and i have installed python3.3 This is what worked for me.
You need to have freetype.
sudo apt-get install freetype*
You need to have freetype.
sudo apt-get install python3.3-dev
You need to have g++.
sudo apt-get install g++
You need to have libevent-dev
sudo apt-get install libevent-dev
You need to have libpng-dev
sudo apt-get install libpng-dev
You need to have libjpeg8-dev
sudo apt-get install libjpeg8-dev
You need to have python3.3-tk
sudo apt-get install python3.3-tk
You need to have tk-dev
sudo apt-get install tk-dev
You need to have python-gtk2-dev
sudo apt-get install python-gtk2-dev
Get the tar file from the website and untar it in the dist-packages /usr/local/lib/python3.3/dist-packages/matplotlib-1.3.1.
sudo python3.3 setup.py clean (this might be optional)
sudo python3.3 setup.py install
NOTE: I had to change the matplotlibrc file in the dist-packages in the mpl-data directory.
The backend line was changed from agg to TkAgg and interactive was set to True.