#2900: matplotlib bug in imshow (probably fixed in new version)
----------------------+-----------------------------------------------------
Reporter: cwitty | Owner: mabshoff
Type: defect | Status: new
Priority: major | Milestone: sage-3.2.2
Component: packages | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Comment (by mabshoff):
This still fails with Sage 3.2.1.rc1 (which ships with matplotlib 0.98.3):
{{{
sage: savefig('foo.png')
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
/scratch/mabshoff/release-cycle/sage-3.2.1.final/<ipython console> in
<module>()
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/pyplot.pyc in savefig(*args, **kwargs)
340 def savefig(*args, **kwargs):
341 fig = gcf()
--> 342 return fig.savefig(*args, **kwargs)
343 if Figure.savefig.__doc__ is not None:
344 savefig.__doc__ = dedent(Figure.savefig.__doc__)
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/figure.pyc in savefig(self, *args, **kwargs)
962 patch.set_alpha(0.0)
963
--> 964 self.canvas.print_figure(*args, **kwargs)
965
966 if transparent:
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/backend_bases.pyc in print_figure(self, filename, dpi,
facecolor, edgecolor, orientation, format, **kwargs)
1308 edgecolor=edgecolor,
1309 orientation=orientation,
-> 1310 **kwargs)
1311 finally:
1312 self.figure.dpi = origDPI
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/backends/backend_agg.pyc in print_png(self,
filename_or_obj, *args, **kwargs)
303
304 def print_png(self, filename_or_obj, *args, **kwargs):
--> 305 FigureCanvasAgg.draw(self)
306 renderer = self.get_renderer()
307 original_dpi = renderer.dpi
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/backends/backend_agg.pyc in draw(self)
259
260 self.renderer = self.get_renderer()
--> 261 self.figure.draw(self.renderer)
262
263 def get_renderer(self):
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/figure.pyc in draw(self, renderer)
757
758 # render the axes
--> 759 for a in self.axes: a.draw(renderer)
760
761 # render the figure text
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/axes.pyc in draw(self, renderer, inframe)
1463 if len(self.images)<=1 or
renderer.option_image_nocomposite():
1464 for im in self.images:
-> 1465 im.draw(renderer)
1466 else:
1467 # make a composite image blending alpha
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/image.pyc in draw(self, renderer, *args, **kwargs)
234 self.axes.get_yscale() != 'linear'):
235 warnings.warn("Images are not supported on non-linear
axes.")
--> 236 im = self.make_image(renderer.get_image_magnification())
237 l, b, widthDisplay, heightDisplay = self.axes.bbox.bounds
238 renderer.draw_image(round(l), round(b), im,
self.axes.bbox.frozen(),
/scratch/mabshoff/release-cycle/sage-3.2.1.final/local/lib/python2.5/site-
packages/matplotlib/image.pyc in make_image(self, magnification)
185 else:
186 x = self._rgbacache
--> 187 im = _image.fromarray(x[yslice,xslice], 0)
188 if len(self._A.shape) == 2:
189 im.is_grayscale = self.cmap.is_gray()
ValueError: Array must be rank 2 or 3 of doubles
sage:
Exiting SAGE (CPU time 0m1.32s, Wall time 0m43.85s).
}}}
Cheers,
Michael
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2900#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---