Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Sage does not write irs graphics output to the standard output. You have to save your graphic object to a file.

It appears that 3D graphics can't be saved but to bitmap formats :

`sage -c 'sphere((0, 0, 0), 1).save(filename="foo.png", viewer="tachyon")'`

works as advertised, but :

sage -c 'sphere((0, 0, 0), 1).save(filename="foo.pgf", viewer="tachyon")'
Traceback (most recent call last):
  File "/usr/local/sage-8/src/bin/sage-eval", line 10, in <module>
    eval(compile(s,'<cmdline>','exec'))
  File "<cmdline>", line 1, in <module>
  File "sage/plot/plot3d/base.pyx", line 1639, in sage.plot.plot3d.base.Graphics3d.save (build/cythonized/sage/plot/plot3d/base.c:21846)
ValueError: filetype .pgf not supported by save()

HTH,

Sage does not write irs graphics output to the standard output. You have to save your graphic object to a file.

It also appears that 3D graphics can't be saved but to bitmap formats (and some specialized formats, which I don't know) :

`sage -c 'sphere((0, 0, 0), 1).save(filename="foo.png", viewer="tachyon")'`

works as advertised, but :

sage -c 'sphere((0, 0, 0), 1).save(filename="foo.pgf", viewer="tachyon")'
Traceback (most recent call last):
  File "/usr/local/sage-8/src/bin/sage-eval", line 10, in <module>
    eval(compile(s,'<cmdline>','exec'))
  File "<cmdline>", line 1, in <module>
  File "sage/plot/plot3d/base.pyx", line 1639, in sage.plot.plot3d.base.Graphics3d.save (build/cythonized/sage/plot/plot3d/base.c:21846)
ValueError: filetype .pgf not supported by save()

You may try to save to one of the supported specialized 3D formants, and convert that to .pgf, gut I haven't the foggiest idea about the latter...

HTH,