Alex Rivera | Logout

Matplotlib plots not showing up in Mac OSX?

Asked 2010-03-24T23:36:24.470
93

I am running Mac OSX 10.5.8. I installed matplotlib using macports. I get some examples from the matplotlib gallery like this one, without modification:

http://matplotlib.sourceforge.net/examples/api/unicode_minus.html

I run it, get no error, but the picture does not show up. In Linux Ubuntu I get it.

Do you know what could be wrong here?

Edit
Report

1 Answer

2

I only had python 2.5 and I did not want to install python 2.6 on my mac. So I used different procedure mentioned in the following link to solve this problem:

http://www.gtkforums.com/viewtopic.php?f=3&t=54928

What that one actually needs is the following steps:

1) Searching where is the directory "pygtk-2.0.pc" and locate it. For example mine was located in the following directory:

/opt/local/lib/pkgconfig

2) Adding the path information to envirement variable. For example:

PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
export PKG_CONFIG_PATH

3) Download the configuration information file "matplotlibrc" from matplotlib website http://matplotlib.sourceforge.net/_static/matplotlibrc

4) Change backend to MacOSX in the file and save it

5) Copy the file to directory .matplotlib You can locate the directory in python by the following command:

import matplotlib
matplotlib.get_configdir()
answered 2011-11-04T10:29:56.197

Your Answer