From: Carol L. <car...@sr...> - 2004-12-01 17:19:59
|
> Yep, this is a bug. In backend_ps in the the set_linedashes function > on line 103, replace the line > > if seq: > > with > > if seq is not None and len(seq): > > My guess is you are using numarray, and if memory serves numarray but > not Numeric fails on using an array as a boolean, which is what > backend ps is doing here. > > Yes, I am using numarray. I made the change to line 103 and now line 102 is reporting a similar error. Traceback (most recent call last): File "testoverlay.py", line 91, in ? savefig('overlay.ps') File "/usr/lib/python2.3/site-packages/matplotlib/matlab.py", line 1008, in savefig manager.canvas.print_figure(*args, **kwargs) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtkagg.py", line 66, in print_figure agg.print_figure(filename, dpi, facecolor, edgecolor, orientation) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py", line 385, in print_figure ps.print_figure(filename, dpi, facecolor, edgecolor, orientation) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 570, in print_figure self.figure.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line 254, in draw for a in self.axes: a.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 3125, in draw l.draw(renderer) File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line 257, in draw lineFunc(renderer, gc, xt, yt) File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line 513, in _draw_dotted renderer.draw_lines(gc, xt, yt) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 275, in draw_lines self._draw_lines(gc,points[0:1000]) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 264, in _draw_lines self._draw_ps("\n".join(ps), gc, None) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 375, in _draw_ps self.set_linedash(*gc.get_dashes()) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py", line 102, in set_linedash if (offset,seq) != self.linedash: File "/usr/lib/python2.3/site-packages/numarray/generic.py", line 477, in __nonzero__ raise RuntimeError("An array doesn't make sense as a truth value. Use sometrue(a) or alltrue(a).") RuntimeError: An array doesn't make sense as a truth value. Use sometrue(a) or alltrue(a). -- Ms. Carol A. Leger SRI International Phone: (650) 859-4114 333 Ravenswood Avenue G-273 Menlo Park, CA 94025 e-mail: le...@sr... |