From: Arnold M. <arn...@wu...> - 2005-03-03 15:14:58
|
Dear all, The following simple script gives an error on matplotlib-0.72.1: # Start script from pylab import * from Numeric import * x=arange(0.1,10,0.1) y=sin(x) grid() plot(x,y) savefig('foo.eps') # end script The error disappears when I remove the grid() switch. The error message is: File "foo.py", line 10, in ? savefig('foo.eps') File "/usr/lib/python2.3/site-packages/matplotlib/pylab.py", line 763, in savefig try: ret = fig.savefig(*args, **kwargs) File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line 455, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 646, in print_figure self.figure.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line 338, in draw for a in self.axes: a.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 1281, in draw self.xaxis.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 523, in draw tick.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/axis.py", line 135, in draw if midPoint and self.gridOn: self.gridline.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line 283, in draw lineFunc(renderer, gc, xt, yt) File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line 569, in _draw_dotted renderer.draw_lines(gc, xt, yt) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 355, in draw_lines self._draw_lines(gc,to_draw) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 338, in _draw_lines self._draw_ps("\n".join(ps), gc, None) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 453, in _draw_ps self.set_linewidth(gc.get_linewidth()) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 114, in set_linewidth self._pswriter.write("%1.3f setlinewidth\n"%linewidth) TypeError: float argument required The error disappears (or at least is no longer visible) when I replace line 113 in backend_ps.py by: self._pswriter.write("%1.3f setlinewidth\n"%float(linewidth)) I hope someone can make a thorough fix. At the moment I can live with my workaround. Cheers, Arnold -- ------------------------------------------------------------------------ Arnold F. Moene NEW tel: +31 (0)317 482604 Meteorology and Air Quality Group fax: +31 (0)317 482811 Wageningen University e-mail: Arnold.Moene at wur.nl Duivendaal 2 url: http://www.met.wau.nl 6701 AP Wageningen The Netherlands ------------------------------------------------------------------------ Openoffice.org - Freedom at work Firefox - The browser you can trust (www.mozilla.org) ------------------------------------------------------------------------ |
From: Andrea R. <ari...@pi...> - 2005-03-03 17:10:14
|
I don't know if it could help, but with matplotlib 0.71, the version I've installed, the error doesn't occur. HTH, Andrea. On 3 Mar 2005, at 16:14, Arnold Moene wrote: > Dear all, > > The following simple script gives an error on matplotlib-0.72.1: > # Start script > from pylab import * > from Numeric import * > > x=arange(0.1,10,0.1) > y=sin(x) > > grid() > plot(x,y) > savefig('foo.eps') > # end script |
From: John H. <jdh...@ac...> - 2005-03-04 14:39:31
|
>>>>> "Arnold" == Arnold Moene <arn...@wu...> writes: Arnold> Dear all, The following simple script gives an error on Arnold> matplotlib-0.72.1: # Start script from pylab import * from Arnold> Numeric import * Arnold> x=arange(0.1,10,0.1) y=sin(x) Arnold> grid() plot(x,y) savefig('foo.eps') # end script Arnold> The error disappears when I remove the grid() switch. I cannot replicate this bug with 0.72.1 or matplotlib CVS. Could you rm -rf site-packages/matplotlib, reinstall, and run your script with --verbose-helpful? If you still get the error, send the output of the run so I can use the extra diagnostic information. Thanks, JDH |
From: Arnold M. <arn...@wu...> - 2005-03-04 15:45:23
|
Dear John, You win: I thought I had done a clean install, but apparently I didn't. After a rm -rf of site-packages/matplotlib, and a re-install everything worked fine. So: no bug. Thanks, Arnold Quoting John Hunter <jdh...@ac...>: >>>>>> "Arnold" == Arnold Moene <arn...@wu...> writes: > > Arnold> Dear all, The following simple script gives an error on > Arnold> matplotlib-0.72.1: # Start script from pylab import * from > Arnold> Numeric import * > > Arnold> x=arange(0.1,10,0.1) y=sin(x) > > Arnold> grid() plot(x,y) savefig('foo.eps') # end script > > Arnold> The error disappears when I remove the grid() switch. > > I cannot replicate this bug with 0.72.1 or matplotlib CVS. Could you > rm -rf site-packages/matplotlib, reinstall, and run your script with > --verbose-helpful? If you still get the error, send the output of the > run so I can use the extra diagnostic information. > > Thanks, > JDH > -- ------------------------------------------------------------------------ Arnold F. Moene NEW tel: +31 (0)317 482604 Meteorology and Air Quality Group fax: +31 (0)317 482811 Wageningen University e-mail: Arn...@wu... Duivendaal 2 url: http://www.met.wau.nl 6701 AP Wageningen The Netherlands ------------------------------------------------------------------------ Openoffice.org - Freedom at work Firefox - The browser you can trust (www.mozilla.org) ------------------------------------------------------------------------ |