x x wrote: >> I think the problem here is that .gif is not a recognized image format. >> Try .png instead. >> > > Thanks for the suggestion but p.save("Test.png") also doesn't work. > > The following code: > ------------ > var('x,y,z') > p=implicit_plot3d(x*y+z^2==0, (x, -3, 3), (y, -3, 3), (z, -3, > 3),viewer='tachyon') > p.save? > ------------ > > outputs: > ----------- > File: > /home/niels/Desktop/n/install/sage/sage-4.1.1/devel/sage/sage/structure/sage_object.pyx > > Type: <type ‘builtin_function_or_method’> > > Definition: p.save(filename=’None’, compress=’True’) > > Docstring: > > Save self to the given filename. > > EXAMPLES: > > sage: f = x^3 + 5 > sage: f.save(SAGE_TMP + '/file') > sage: load(SAGE_TMP + '/file.sobj') > x^3 + 5 > -----------
That's right. This has come up before---p.save() for 2d graphics tries to save an image. p.save() for 3d graphics doesn't try to save an image. It's an inconsistency. One way to get fix this is to override the 3d graphics save routine to do what the 2d graphics save routine does---look at the file extension and if it is a recognized image extension, save the image; otherwise, save a Sage sobj pickle. This is also why 3d things don't work with animate(). animate() expects to be able to do p.save('test.png') and have a graphic image test.png saved out to disk. You can save a 3d graphics by hand by plotting in jmol and either selecting "Get Image" next to the image, which converts to jpg, or if you're doing this from the command line, you can select File|Export from the java viewer that pops up. That's rather laborious for creating an animation, though. To get an image using tachyon, use show() with filename and viewer parameters: sage: show(sphere(), filename='test',viewer='tachyon') You can use that trick to make a .save() method for 3d graphics (maybe TransformGroup class or something?) that behaves like the 2d graphics save. Then animate should work. I don't have time to do this right now, but I think this should give someone enough information to be able to fix things if they are interested. Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---