#2872: 3d graphics can't be saved to a file
------------------------------------------+---------------------------------
Reporter: was | Owner: was
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.3.3
Component: graphics | Keywords:
Author: Bill Cauchois | Upstream: N/A
Reviewer: Tim Dumol, Robert Bradshaw | Merged:
Work_issues: 1 doctest |
------------------------------------------+---------------------------------
Changes (by mpatel):
* status: needs_work => needs_review
Old description:
> The bug is described below. To fix this and close this ticket, just
> slightly
> refactor the code in sage/sage/plot/plot3d/base.pyx so that save to png
> on a 3d image
> saves the tachyon rendered file, gives an sobj on an sobj or no
> extension, and
> gives an error on all other extension. This will be all one gets
> initially.
>
> Another *later* ticket should -- if possible -- make it possible to get
> the static
> image from jmol (if possible).
>
> {{{
> On Thu, Apr 10, 2008 at 11:42 AM, Hector Villafuerte wrote:
> >
> > Hi,
> > I noticed the following (inconsistent?) behavior: saving 2D plots
> > works as expected (a graphic file is stored), but saving 3D plots
> > gives .sobj files instead (see sample code below). Is there a way to
> > save 3D plots from the Notebook? By the way, I know how to save them
> > using jMol's GUI (as reached from Sage terminal), but the idea is to
> > be able to script this.
> >
>
> This is a bug. There's currently no easy nice way to script
> saving 3d graphics using Tachyon. If you do the following
>
> sage: p = point3d([(k,k^2,0) for k in [0..10]], size=5,
> viewer='tachyon')
> sage: p.show(filename='a', viewer='tachyon')
>
> then the file a.png will be produced but unfortunately a browser window
> will also appear showing this file.
>
> > --
> > Hector
> >
> >
> > sage: p = point([(k,k^2) for k in [0..10]])
> > sage: p.save(DATA+'plot2d.png')
> > sage: type(p)
> > <class 'sage.plot.plot.Graphics'>
> >
> > sage: p = point3d([(k,k^2,0) for k in [0..10]], size=5)
> > sage: p.save(DATA+'plot3d-1.png')
> > sage: type(p)
> > <class 'sage.plot.plot3d.base.Graphics3dGroup'>
> >
> > sage: p = point3d([(k,k^2,0) for k in [0..10]], size=5,
> viewer='tachyon')
> > sage: p.save(DATA+'plot3d-2.png')
> > sage: type(p)
> > <class 'sage.plot.plot3d.base.Graphics3dGroup'>
>
> }}}
New description:
The bug is described below. To fix this and close this ticket, just
slightly refactor the code in sage/sage/plot/plot3d/base.pyx so that save
to png on a 3d image saves the tachyon rendered file, gives an sobj on an
sobj or no extension, and gives an error on all other extension. This
will be all one gets initially.
Another *later* ticket should -- if possible -- make it possible to get
the static image from jmol (if possible).
{{{
On Thu, Apr 10, 2008 at 11:42 AM, Hector Villafuerte wrote:
>
> Hi,
> I noticed the following (inconsistent?) behavior: saving 2D plots
> works as expected (a graphic file is stored), but saving 3D plots
> gives .sobj files instead (see sample code below). Is there a way to
> save 3D plots from the Notebook? By the way, I know how to save them
> using jMol's GUI (as reached from Sage terminal), but the idea is to
> be able to script this.
>
This is a bug. There's currently no easy nice way to script
saving 3d graphics using Tachyon. If you do the following
sage: p = point3d([(k,k^2,0) for k in [0..10]], size=5,
viewer='tachyon')
sage: p.show(filename='a', viewer='tachyon')
then the file a.png will be produced but unfortunately a browser window
will also appear showing this file.
> --
> Hector
>
>
> sage: p = point([(k,k^2) for k in [0..10]])
> sage: p.save(DATA+'plot2d.png')
> sage: type(p)
> <class 'sage.plot.plot.Graphics'>
>
> sage: p = point3d([(k,k^2,0) for k in [0..10]], size=5)
> sage: p.save(DATA+'plot3d-1.png')
> sage: type(p)
> <class 'sage.plot.plot3d.base.Graphics3dGroup'>
>
> sage: p = point3d([(k,k^2,0) for k in [0..10]], size=5,
viewer='tachyon')
> sage: p.save(DATA+'plot3d-2.png')
> sage: type(p)
> <class 'sage.plot.plot3d.base.Graphics3dGroup'>
}}}
Depends onĀ #8235.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2872#comment:17>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.