From: John H. <jdh...@ac...> - 2006-03-01 17:23:09
|
>>>>> "Finny" == Finny Kuruvilla <kur...@mo...> writes: Finny> I'm not exactly sure why this is true, but I've empirically Finny> found this out to be the case. If anyone knows why, I'd Finny> sure love to know. matplotlib will work with numpy, numarray *or* Numeric, but it doesn't work with all three at the same time. You need to set your "numerix" setting in your config file to agree with which package you are using (and then restart python). An example rc file is at http://matplotlib.sf.net/matplotlibrc We provide a numerix compatibility layer which you can consider using so you won't get into these troubles. This essentially guarantees that the array object you are using is the same as the one you have set in your configuration file import matplotlib.numerix as nx x=nx.array([1,2]) hist(x) You can inspect the value of the numerix parameter with import matplotlib print matplotlib.rcParams['numerix'] rcParams is a dictionary mapping a configuration parameter to a value. Most of these can be changed dynamically at runtime, but two, the 'numerix' and the 'backend' setting must be changed before importing the numerix module and pylab, respectively, because these trigger imports that are not easily undone. Most people just set these once in their rc file and are done with it, but you can set them in a script with from matplotlib import rcParams rcParams['numerix] = 'numpy' rcParams['backend'] = 'PS' # it is now safe to import numerix and pylab import matplotlib.numerix as nx # you'll be using numpy import pylab # with the postscript backend as default JDH JDH |