From: Andrew S. <str...@as...> - 2004-05-20 22:21:12
|
when running the following simple script: from matplotlib.matlab import * from numarray import * theta = arange(0.0,8*pi,0.1) a=1 b=.2 dt = 0.0 x = a*cos( theta )*exp(b*theta) y = a*sin( theta )*exp(b*theta) plot(x,y) show() #savefig('ss') with the following combination of software: matplotlib 0.54 numarray 0.9 python 2.2.1 windows XP if I use WXAgg or Agg, I get this: Traceback (most recent call last): File "simple_spiral.py", line 13, in ? show() File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1124, in show figwin.canvas.draw() File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 50, in draw agg.draw() File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_agg.py", line 299, in draw self.figure.draw(self.renderer) File "C:\Python22\Lib\site-packages\matplotlib\figure.py", line 128, in draw for a in self.axes: a.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\axes.py", line 603, in draw self.xaxis.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\axis.py", line 463, in draw tick.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\axis.py", line 125, in draw if midPoint and self.tick1On: self.tick1line.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\lines.py", line 193, in draw self._lineFunc(renderer, gc, xt, yt) File "C:\Python22\Lib\site-packages\matplotlib\lines.py", line 326, in _draw_solid renderer.draw_lines(gc, xt,yt) TypeError: can't convert complex to float; use e.g. abs(z) if I use PS, I get this: Traceback (most recent call last): File "simple_spiral.py", line 14, in ? savefig('ss') File "C:\Python22\Lib\site-packages\matplotlib\matlab.py", line 1156, in savefig manager.canvas.print_figure(*args, **kwargs) File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_ps.py", line 378, in print_figure self.figure.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\figure.py", line 128, in draw for a in self.axes: a.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\axes.py", line 603, in draw self.xaxis.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\axis.py", line 463, in draw tick.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\axis.py", line 125, in draw if midPoint and self.tick1On: self.tick1line.draw(renderer) File "C:\Python22\Lib\site-packages\matplotlib\lines.py", line 193, in draw self._lineFunc(renderer, gc, xt, yt) File "C:\Python22\Lib\site-packages\matplotlib\lines.py", line 326, in _draw_solid renderer.draw_lines(gc, xt,yt) File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_ps.py", line 103, in draw_lines ps.append('newpath %s moveto' % _nums_to_str((x[0], y[0]))) File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_ps.py", line 36, in _nums_to_str return ' '.join([_int_or_float(val, fmt) for val in seq]) File "C:\Python22\Lib\site-packages\matplotlib\backends\backend_ps.py", line 41, in _int_or_float ival = int(val) TypeError: can't convert complex to int; use e.g. int(abs(z)) |