On Apr 8, 4:34 am, "Fabio Tonti" <[EMAIL PROTECTED]> wrote: > sage: from pylab import * > sage: imshow([[(0,0,0)]]) > sage: savefig('foo.png') > Traceback (most recent call last): > ... > NameError: global name 'npy' is not defined > > I would just like to make an image from a 2-dimensional Array (of > rgb-values)!
This is a bug in our current version of matplotlib; it is being tracked here: http://trac.sagemath.org/sage_trac/ticket/2900 For now, it looks like you may be able to work around the problem by using RGBA 4-tuples instead of RGB 3-tuples; that is, add an extra ", 255" on the end of each pixel. You also need to be sure to use Python ints instead of Sage integers. So with the commands: sage: imshow([[(0r,0r,0r,255r)]]) sage: savefig('foo.png') I at least don't get any more exceptions, and I do get a saved image. However, I don't see a black pixel in the saved image, so it may not actually be working. Carl --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---