As I have detailed in a previous post the installation of MatPlotLib on Mac OS was a fairly involved process involving the using of Mac Ports to compile and build a complete Python stack.  Thankfully it would seem things have become much simpler on Mac OS X 10.6.7 if you are installing Python 2.7.1, MatPlotLib 1.0.1 and iPython 0.10.1.  Note: currently only the 32 bit version of Python will work consistently with MatPlotLib and iPython.

  1. First Python 2.7.1:
    1. Download the prebuilt ‘Python 2.7.1 Mac OS X 32-bit i386/PPC Installer’ DMG from python.org.
    2. Mount the DMG image and run the contained installer.
    3. Verify it worked by opening a terminal and running the command ‘python -V’ which should return ‘Python 2.7.1′.
  2. Next MatPlotLib 1.0.1:
    1. Download the prebuilt ‘matplotlib-1.0.1-python.org-32bit-py2.7-macosx10.3′ DMG from MatPlotLib’s SourceForge page.
    2. Mout the DMG image and  run the contained installer.
    3. Verify this worked by opening a terminal, running python and then ‘import matplotlib’ followed by ‘print matplotlib.__version__’ which should return ‘1.0.1’.
  3. Finally iPython 0.10.1:
    1. Download the iPython source ‘ipython-0.10.1.zip’ from the iPython download directory.
    2. Extract the zip file.
    3. Open a terminal window and CD into the newly extracted directory ‘ipython-0.10.1′.
    4. Run the command ‘sudo python setup.py install’ and enter your password when prompted.
    5. Verify this by running iPython with MatPlotLib via ‘ipython -pylab’ and then ‘x = randn(10000)’ followed by ‘hist(x, 100)’ and a chart window like the following image should pop up.