Ask Your Question

Saving 3d image as svg or pdf

asked 2021-03-16 22:45:15 +0200

alexh gravatar image

The 3-dimensional plots in SageMath are quite good, and easy to use. In particular moving the camera angle interactively in the sage worksheet is very helpful. But I can't figure out how to output the image as .svg or .pdf...

The journal requires .svg or .pdf. I can re-compute all the figures in SageMath, but I can't figure out how to output an .svg or .pdf. Is there a way?

edit retag flag offensive close merge delete


lb gravatar imagelb ( 2021-03-21 00:39:17 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-03-16 23:52:04 +0200

cav_rt gravatar image

The docstring of the save method says:

Save the graphic in a file.

The file type depends on the file extension you give in the filename. This can be either:

  • an image file (of type: PNG, BMP, GIF, PPM, or TIFF) rendered using Jmol (default) or Tachyon,

  • a Sage object file (of type ".sobj") that you can load back later (a pickle),

  • an HTML file depicting the graphic using the Three.js viewer,

  • a data file (of type: X3D, STL, AMF, PLY) for export and use in other software.

    For data files, the support is only partial. For instance STL and AMF only works for triangulated surfaces. The prefered format is X3D.

A workaround, possible not the best, could be save in one of these formats and convert to the one you want.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2021-03-16 22:45:15 +0200

Seen: 66 times

Last updated: Mar 16