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.Fri, 25 Sep 2015 17:42:25 +0200sage.plot.plot3d.shapes2.Line() does not work in the cloudhttps://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/The following code (straight from http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/shapes2.html) does not work in the SageMath Cloud, at least not for me:
from sage.plot.plot3d.shapes2 import Line
Line([(i*math.sin(i), i*math.cos(i), i/3) for i in range(30)], arrow_head=True)
The result is a long error message ending with "TypeError: 0 is not JSON serializable". Am I doing something wrong?Wed, 23 Sep 2015 20:49:15 +0200https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/Comment by Jeremy Martin for <p>The following code (straight from <a href="http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/shapes2.html">http://doc.sagemath.org/html/en/refer...</a>) does not work in the SageMath Cloud, at least not for me:</p>
<pre><code>from sage.plot.plot3d.shapes2 import Line
Line([(i*math.sin(i), i*math.cos(i), i/3) for i in range(30)], arrow_head=True)
</code></pre>
<p>The result is a long error message ending with "TypeError: 0 is not JSON serializable". Am I doing something wrong?</p>
https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?comment=29567#post-id-29567I guess I can just use line3d() instead.... but maybe this error indicates something else is going on.Thu, 24 Sep 2015 18:35:08 +0200https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?comment=29567#post-id-29567Comment by kcrisman for <p>The following code (straight from <a href="http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/shapes2.html">http://doc.sagemath.org/html/en/refer...</a>) does not work in the SageMath Cloud, at least not for me:</p>
<pre><code>from sage.plot.plot3d.shapes2 import Line
Line([(i*math.sin(i), i*math.cos(i), i/3) for i in range(30)], arrow_head=True)
</code></pre>
<p>The result is a long error message ending with "TypeError: 0 is not JSON serializable". Am I doing something wrong?</p>
https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?comment=29578#post-id-29578I think this is a SMC 3d renderer bug, as this works fine in the normal Sage notebook.Fri, 25 Sep 2015 09:23:41 +0200https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?comment=29578#post-id-29578Comment by William Stein for <p>The following code (straight from <a href="http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/shapes2.html">http://doc.sagemath.org/html/en/refer...</a>) does not work in the SageMath Cloud, at least not for me:</p>
<pre><code>from sage.plot.plot3d.shapes2 import Line
Line([(i*math.sin(i), i*math.cos(i), i/3) for i in range(30)], arrow_head=True)
</code></pre>
<p>The result is a long error message ending with "TypeError: 0 is not JSON serializable". Am I doing something wrong?</p>
https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?comment=29592#post-id-29592I've created a ticket: https://github.com/sagemathinc/smc/issues/130Fri, 25 Sep 2015 17:42:25 +0200https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?comment=29592#post-id-29592Answer by fidbc for <p>The following code (straight from <a href="http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/shapes2.html">http://doc.sagemath.org/html/en/refer...</a>) does not work in the SageMath Cloud, at least not for me:</p>
<pre><code>from sage.plot.plot3d.shapes2 import Line
Line([(i*math.sin(i), i*math.cos(i), i/3) for i in range(30)], arrow_head=True)
</code></pre>
<p>The result is a long error message ending with "TypeError: 0 is not JSON serializable". Am I doing something wrong?</p>
https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?answer=29552#post-id-29552You don't seem to be doing anything wrong.
Another option to get similar output is to use the `line3d` function.
line3d([(i*math.sin(i), i*math.cos(i), i/3) for i in range(30)], arrow_head=True)
Thu, 24 Sep 2015 02:31:59 +0200https://ask.sagemath.org/question/29546/sageplotplot3dshapes2line-does-not-work-in-the-cloud/?answer=29552#post-id-29552