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.Tue, 26 Mar 2019 21:36:23 +0100in command mode plot3d not displaying - only says "Graphics3d Object"https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/ - I use sagemath in a virtual machine
(osboxes.org). To get a text copy of
the output, and some latex and TikZ
code it is convenient for me to use a
*linux* terminal and launching something like
/home/osboxes/SageMath/./sage /FilesSage/GSphereShowTest.sage | tee /FilesSage/GSphereShowTestOutput.txt
the problem is I do not have a
3dplot: the terminal only states
"Graphics3d Object".
- To simplify I tried just
/home/osboxes/SageMath/./sage
/FilesSage/GSphereShowTest.sage
to no avail.
- There is already a question with a
similar problem ([plot3d not
displaying - only says "Graphics3d
Object"?!](https://ask.sagemath.org/question/41731/plot3d-not-displaying-only-says-graphics3d-object/)) but the solution does not
apply. Here there is no max min.
The same test works without any problem with a *sage* terminal
The test code is just:
G=sphere((0,0,0),1)
show(G, viewer='jmol')
print 'say Hello'``
What should be done to get access to the viewer in a linux terminal?
Mon, 25 Mar 2019 23:32:26 +0100https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/Comment by c05772 for <ul>
<li><p>I use sagemath in a virtual machine
(<a href="http://osboxes.org">osboxes.org</a>). To get a text copy of
the output, and some latex and TikZ
code it is convenient for me to use a
<em>linux</em> terminal and launching something like</p>
<p>/home/osboxes/SageMath/./sage /FilesSage/GSphereShowTest.sage | tee /FilesSage/GSphereShowTestOutput.txt</p>
<p>the problem is I do not have a
3dplot: the terminal only states
"Graphics3d Object".</p></li>
<li><p>To simplify I tried just </p>
<p>/home/osboxes/SageMath/./sage
/FilesSage/GSphereShowTest.sage</p>
<p>to no avail.</p></li>
<li>There is already a question with a
similar problem (<a href="https://ask.sagemath.org/question/41731/plot3d-not-displaying-only-says-graphics3d-object/">plot3d not
displaying - only says "Graphics3d
Object"?!</a>) but the solution does not
apply. Here there is no max min. </li>
</ul>
<p>The same test works without any problem with a <em>sage</em> terminal</p>
<p>The test code is just: </p>
<pre><code>G=sphere((0,0,0),1)
show(G, viewer='jmol')
print 'say Hello'``
</code></pre>
<p>What should be done to get access to the viewer in a linux terminal?</p>
https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45927#post-id-45927No, I tried the three viewers, jmol, tachyon and threejs.Tue, 26 Mar 2019 16:19:38 +0100https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45927#post-id-45927Comment by eric_g for <ul>
<li><p>I use sagemath in a virtual machine
(<a href="http://osboxes.org">osboxes.org</a>). To get a text copy of
the output, and some latex and TikZ
code it is convenient for me to use a
<em>linux</em> terminal and launching something like</p>
<p>/home/osboxes/SageMath/./sage /FilesSage/GSphereShowTest.sage | tee /FilesSage/GSphereShowTestOutput.txt</p>
<p>the problem is I do not have a
3dplot: the terminal only states
"Graphics3d Object".</p></li>
<li><p>To simplify I tried just </p>
<p>/home/osboxes/SageMath/./sage
/FilesSage/GSphereShowTest.sage</p>
<p>to no avail.</p></li>
<li>There is already a question with a
similar problem (<a href="https://ask.sagemath.org/question/41731/plot3d-not-displaying-only-says-graphics3d-object/">plot3d not
displaying - only says "Graphics3d
Object"?!</a>) but the solution does not
apply. Here there is no max min. </li>
</ul>
<p>The same test works without any problem with a <em>sage</em> terminal</p>
<p>The test code is just: </p>
<pre><code>G=sphere((0,0,0),1)
show(G, viewer='jmol')
print 'say Hello'``
</code></pre>
<p>What should be done to get access to the viewer in a linux terminal?</p>
https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45924#post-id-45924Does
show(G, viewer='threejs')
work?Tue, 26 Mar 2019 14:35:35 +0100https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45924#post-id-45924Answer by Emmanuel Charpentier for <ul>
<li><p>I use sagemath in a virtual machine
(<a href="http://osboxes.org">osboxes.org</a>). To get a text copy of
the output, and some latex and TikZ
code it is convenient for me to use a
<em>linux</em> terminal and launching something like</p>
<p>/home/osboxes/SageMath/./sage /FilesSage/GSphereShowTest.sage | tee /FilesSage/GSphereShowTestOutput.txt</p>
<p>the problem is I do not have a
3dplot: the terminal only states
"Graphics3d Object".</p></li>
<li><p>To simplify I tried just </p>
<p>/home/osboxes/SageMath/./sage
/FilesSage/GSphereShowTest.sage</p>
<p>to no avail.</p></li>
<li>There is already a question with a
similar problem (<a href="https://ask.sagemath.org/question/41731/plot3d-not-displaying-only-says-graphics3d-object/">plot3d not
displaying - only says "Graphics3d
Object"?!</a>) but the solution does not
apply. Here there is no max min. </li>
</ul>
<p>The same test works without any problem with a <em>sage</em> terminal</p>
<p>The test code is just: </p>
<pre><code>G=sphere((0,0,0),1)
show(G, viewer='jmol')
print 'say Hello'``
</code></pre>
<p>What should be done to get access to the viewer in a linux terminal?</p>
https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?answer=45917#post-id-45917Sage 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,Tue, 26 Mar 2019 09:00:48 +0100https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?answer=45917#post-id-45917Comment by c05772 for <p>Sage does not write irs graphics output to the standard output. You have to save your graphic object to a file.</p>
<p>It also appears that 3D graphics can't be saved but to bitmap formats (and some specialized formats, which I don't know) :</p>
<pre><code>`sage -c 'sphere((0, 0, 0), 1).save(filename="foo.png", viewer="tachyon")'`
</code></pre>
<p>works as advertised, but :</p>
<pre><code>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()
</code></pre>
<p>You may try to save to one of the supported specialized 3D formants, and convert that to <code>.pgf</code>, gut I haven't the foggiest idea about the latter...</p>
<p>HTH,</p>
https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45928#post-id-45928I think this answers the question (I tried the command
sage 'sphere((0, 0, 0), 1).save(filename="foo.png", viewer="tachyon")'
which works fine in the test program, no -c option), but of course it does solve not the problem which was to be able to export the Graphics3d object. At least it avoids spending hours looking a non-existing solution.
In a general way it is a weakness because the 3D jmol cannot be exported from the Windows version with jupyter either (cf. [https://ask.sagemath.org/question/39269/launched-jmol-viewer-for-graphics3d-object-fails/] )
The only work around I see is to run the file twice, once in the terminal and cut and paste it i the browser of the virtual machine, run it and export the jmol figure from there with a right click.Tue, 26 Mar 2019 21:15:14 +0100https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45928#post-id-45928Comment by Emmanuel Charpentier for <p>Sage does not write irs graphics output to the standard output. You have to save your graphic object to a file.</p>
<p>It also appears that 3D graphics can't be saved but to bitmap formats (and some specialized formats, which I don't know) :</p>
<pre><code>`sage -c 'sphere((0, 0, 0), 1).save(filename="foo.png", viewer="tachyon")'`
</code></pre>
<p>works as advertised, but :</p>
<pre><code>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()
</code></pre>
<p>You may try to save to one of the supported specialized 3D formants, and convert that to <code>.pgf</code>, gut I haven't the foggiest idea about the latter...</p>
<p>HTH,</p>
https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45929#post-id-45929As far as I know, you **can** export (dump) the *Sage* 3D object. But it can be loaded in Sage only but possibly on another platform)..
Similarly, you can export it to some specialized formats I know zilch about. If you happen to have the right libraries on your target machine, this might be an option.Tue, 26 Mar 2019 21:36:23 +0100https://ask.sagemath.org/question/45905/in-command-mode-plot3d-not-displaying-only-says-graphics3d-object/?comment=45929#post-id-45929