From: Michael D. <md...@st...> - 2007-12-11 17:54:14
|
I think the problem might be related to using numarray and not numpy. matplotlib is not heavily tested (if at all) on anything but numpy anymore. See this from your output log: D:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\numerix\__init__.py:65: DeprecationWarning: numarray use as a numerix backed for matplotlib is deprecated DeprecationWarning, stacklevel=1) Indeed, using "float" as a type specifier works with numpy but not with numarray. Try setting your "numerix" setting to "numpy" in your matplotlibrc file. If there are good reasons that you need to keep using numarray (for compatibility with your own code for instance), please mention that on this list -- there may be workarounds. Cheers, Mike Thorsten.G wrote: > Hello i' am an newbie in matplotlib and python! > I've installed python 2.5.1 + numpy 1.0.4 + numarray 1.5.2 but have many > problems ! > I've written an easy plot script > import matplotlib > import pylab > from pylab import arange,sin,pi,plot,xlabel,ylabel,title,grid,show,axis > > ymax = max([1,4,9,16,12,5,7,13,7,1,33]) > ymin = min([1,-4,9,16,12,5,7,13,7,1,33]) > print 'ymax = %s' % ymax > print 'ymin = %s' % ymin > plot([1,2,3,4,5,6,7,8,9,10,11], [1,4,9,16,12,5,7,13,7,1,33], 'ro') > axis([0, 15, ymin-5, ymax+5]) > xlabel('time (s)') > ylabel('voltage (mV)') > title('About as simple as it gets, folks') > grid(True) > show() > > --> AND i get some problems > > D:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\numerix\__init__.py:65: > DeprecationWarning: numarray use as a numerix backed for matplotlib is > deprecated > DeprecationWarning, stacklevel=1) > Traceback (most recent call last): > File "D:\workspace-py\GDOParser\PlotTest.py", line 12, in <module> > plot([1,2,3,4], [1,4,9,16], 'ro') > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\pyplot.py", line 1775, in > plot > b = ishold() > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\pyplot.py", line 340, in > ishold > return gca().ishold() > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\pyplot.py", line 433, in gca > ax = gcf().gca(**kwargs) > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\figure.py", line 722, in gca > return self.add_subplot(111, **kwargs) > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\figure.py", line 542, in > add_subplot > a = Subplot(self, *args, **kwargs) > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axes.py", > line 5561, in __init__ > self.figW, self.figH], **kwargs) > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axes.py", > line 507, in __init__ > self._init_axis() > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axes.py", > line 545, in _init_axis > self.xaxis = maxis.XAxis(self) > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py", > line 518, in __init__ > self.cla() > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py", > line 553, in cla > self.majorTicks.extend([self._get_tick(major=True) for i in range(1)]) > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py", > line 1033, in _get_tick > return XTick(self.axes, 0, '', major=major) > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py", > line 96, in __init__ > self.tick1line = self._get_tick1line(loc) > File "d:\Program Files\Python-2.5.1\Lib\site-packages\matplotlib\axis.py", > line 285, in _get_tick1line > markersize=self._size, > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\lines.py", line 284, in > __init__ > self.set_data(xdata, ydata) > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\lines.py", line 405, in > set_data > self.recache() > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\matplotlib\lines.py", line 410, in > recache > x = ma.asarray(self.convert_xunits(self._xorig), float) > File "D:\Program Files\Python-2.5.1\Lib\site-packages\numarray\ma\MA.py", > line 2164, in asarray > return array(data, typecode=typecode, copy=0) > File "D:\Program Files\Python-2.5.1\Lib\site-packages\numarray\ma\MA.py", > line 628, in __init__ > c = Numeric.array(data, tc, savespace=ss) > File "D:\Program > Files\Python-2.5.1\Lib\site-packages\numarray\numarraycore.py", line 334, in > array > type=_nt._typeFromKeywords(type,typecode,dtype) > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\numarray\numerictypes.py", line 474, in > _typeFromKeywords > return getType(typecode) > File "d:\Program > Files\Python-2.5.1\Lib\site-packages\numarray\numerictypes.py", line 450, in > getType > raise TypeError("Not a numeric type") > TypeError: Not a numeric type > > Has anyone an idea? > Thanks Thorsten > > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |