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.Wed, 18 May 2011 10:01:39 +02003d plots without Javahttps://ask.sagemath.org/question/7991/3d-plots-without-java/Hello!
Is it possible to get a "static" plot of 3D-data? For example, if I state the fixed angles of view and want to get simply a PNG file.
Maybe something like the command
gnuplot -e 'set terminal png; set view 80,30; splot "output.txt"'
gives.
If it isn't implemented in Sage right now, is it planned?
Thanks.Tue, 17 May 2011 18:53:54 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/Answer by benjaminfjones for <p>Hello!
Is it possible to get a "static" plot of 3D-data? For example, if I state the fixed angles of view and want to get simply a PNG file.
Maybe something like the command</p>
<pre><code>gnuplot -e 'set terminal png; set view 80,30; splot "output.txt"'
</code></pre>
<p>gives.</p>
<p>If it isn't implemented in Sage right now, is it planned?
Thanks.</p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?answer=12358#post-id-12358There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:
sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
or..
sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
Here is the section of the Sage manual: [Tachyon](http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html)Tue, 17 May 2011 19:18:51 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?answer=12358#post-id-12358Comment by benjaminfjones for <p>There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:</p>
<pre><code>sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
</code></pre>
<p>or..</p>
<pre><code>sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
</code></pre>
<p>Here is the section of the Sage manual: <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon</a></p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21727#post-id-21727Nice! I didn't realize that was available.Tue, 17 May 2011 20:30:21 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21727#post-id-21727Comment by kcrisman for <p>There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:</p>
<pre><code>sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
</code></pre>
<p>or..</p>
<pre><code>sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
</code></pre>
<p>Here is the section of the Sage manual: <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon</a></p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21724#post-id-21724Though one should point out that this doesn't work so well with the particular example given in L. See http://www.sagemath.org/doc/reference/sage/plot/plot3d/base.html for an example where it is really nice. Tue, 17 May 2011 22:54:16 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21724#post-id-21724Comment by deebs67 for <p>There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:</p>
<pre><code>sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
</code></pre>
<p>or..</p>
<pre><code>sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
</code></pre>
<p>Here is the section of the Sage manual: <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon</a></p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21721#post-id-21721It seems to need a var('x,y') before the plot3d() example in the answer above (it did for me anyhow)Wed, 18 May 2011 08:01:46 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21721#post-id-21721Comment by cswiercz for <p>There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:</p>
<pre><code>sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
</code></pre>
<p>or..</p>
<pre><code>sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
</code></pre>
<p>Here is the section of the Sage manual: <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon</a></p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21728#post-id-21728Also, on a somewhat related note, if you want a "dynamic"/interactive plot without Java you can use " viewer='canvas3d' " for an HTML5-based 3d plot.Tue, 17 May 2011 20:27:01 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21728#post-id-21728Comment by kcrisman for <p>There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:</p>
<pre><code>sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
</code></pre>
<p>or..</p>
<pre><code>sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
</code></pre>
<p>Here is the section of the Sage manual: <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon</a></p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21720#post-id-21720Yes, I've updated to that effect. Often it's already been previously defined in the session, which is why we often forget it :)Wed, 18 May 2011 10:01:39 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21720#post-id-21720Comment by v_2e for <p>There is a ray-tracer built into Sage called Tachyon. In the example from your previous question, try:</p>
<pre><code>sage: L = [ (1, 1, 1), (1, 5, 7), (8.8, 0, 3), (7.5, 1.91, 11.8), (0, 0, 0) ]
sage: point3d(L, viewer='tachyon')
</code></pre>
<p>or..</p>
<pre><code>sage: x,y=var('x,y')
sage: plot3d(x^2-y^2, (x,-2,2), (y,-2,2), viewer='tachyon')
</code></pre>
<p>Here is the section of the Sage manual: <a href="http://www.sagemath.org/doc/reference/sage/plot/plot3d/tachyon.html">Tachyon</a></p>
https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21722#post-id-21722Thanks a lot! I heard something about Tachyon, but didn't think it was as easy! :) I'll play with it.Wed, 18 May 2011 02:40:12 +0200https://ask.sagemath.org/question/7991/3d-plots-without-java/?comment=21722#post-id-21722