ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 01 Jan 2018 20:04:46 +0100ParametrizedSurface3D to epshttps://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/Can I convert a ParametrizedSurface3D plot to an eps file? I understand it's not a Graphics object, does this mean there's no hope?Mon, 01 Jan 2018 15:55:35 +0100https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/Comment by slelievre for <p>Can I convert a ParametrizedSurface3D plot to an eps file? I understand it's not a Graphics object, does this mean there's no hope?</p>
https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/?comment=40426#post-id-40426Please provide an explicit example that other users can use to explore your question.Mon, 01 Jan 2018 19:52:18 +0100https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/?comment=40426#post-id-40426Comment by slelievre for <p>Can I convert a ParametrizedSurface3D plot to an eps file? I understand it's not a Graphics object, does this mean there's no hope?</p>
https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/?comment=40425#post-id-40425Welcome to Ask Sage! Thank you for your question!Mon, 01 Jan 2018 19:51:35 +0100https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/?comment=40425#post-id-40425Answer by slelievre for <p>Can I convert a ParametrizedSurface3D plot to an eps file? I understand it's not a Graphics object, does this mean there's no hope?</p>
https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/?answer=40428#post-id-40428Sage can output a png or pdf file which you can then convert to eps using tools such as imagemagick.
The examples below are using the following version of Sage:
sage: version()
SageMath version 8.1, Release Date: 2017-12-07
Get the documentation for ParametrizedSurface3D:
sage: ParametrizedSurface3D?
Use an example from the documentation:
sage: u, v = SR.var('u v', domain='real')
sage: eparaboloid = ParametrizedSurface3D((u, v, u^2 + v^2), (u, v), 'elliptic paraboloid')
sage: eparaboloid
Parametrized surface ('elliptic paraboloid') with equation (u, v, u^2 + v^2)
Plotting it with `.plot()` launches the interactive jmol viewer.
sage: eparaboloid.plot()
Launched jmol viewer for Graphics3d Object
Plotting it with `.plot(viewer='tachyon') gives a 2D view, in png.
sage: eparaboloid.plot(viewer='tachyon')
Launched png viewer for Graphics3d Object
We can store the plot in a variable.
sage: p = eparaboloid.plot(viewer='tachyon')
Then save it. Documentation:
sage: p.save_image?
The documentation says in particular:
The image type is determined by the extension of the filename. For
example, this could be ".png", ".jpg", ".gif", ".pdf", ".svg".
Usage:
sage: p.save_image('surface.png')
Then use imagemagick or any other tool to convert the resulting png file to an eps file.Mon, 01 Jan 2018 20:04:46 +0100https://ask.sagemath.org/question/40420/parametrizedsurface3d-to-eps/?answer=40428#post-id-40428