ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 28 Apr 2017 14:54:27 -0500Animation doesn't workhttp://ask.sagemath.org/question/37209/animation-doesnt-work/I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.
f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)Thu, 06 Apr 2017 21:26:38 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/Comment by kcrisman for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37224#post-id-37224Thanks, @mforets, quick work!Fri, 07 Apr 2017 08:00:37 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37224#post-id-37224Comment by mforets for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37223#post-id-37223@cybervigilante - in addition, if you play around with animate and produce some nice illustrative examples do not hesitate to say so -- there is [#13279](https://trac.sagemath.org/ticket/13279) which can benefit from your feedback.Fri, 07 Apr 2017 07:54:58 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37223#post-id-37223Comment by mforets for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37222#post-id-37222@kcrisman - done, it is [#22777](https://trac.sagemath.org/ticket/22777#ticket) (nice number, eh?)Fri, 07 Apr 2017 07:51:03 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37222#post-id-37222Comment by kcrisman for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37219#post-id-37219@cybervigilante - to be fair, in a huge warning at the top of http://doc.sagemath.org/html/en/reference/plotting/sage/plot/animate.html it says you need one of those two tools. The tutorials are not intended, nor could be, comprehensive. If you point out exactly where it didn't say anything about it, that would be helpful so that we can point that documentation to the warning as well, thank you.Fri, 07 Apr 2017 05:28:43 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37219#post-id-37219Comment by kcrisman for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37218#post-id-37218@mforets - did you open a bug report for `animate` not working in the Jupyter? If this starts to be our default then it needs to support things like this.Fri, 07 Apr 2017 05:27:34 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37218#post-id-37218Comment by mforets for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37213#post-id-37213true, `animate` doesn't seem to work in the jupyter notebook (launch via `sage -n jupyter`) as of v7.6. however, it does work in the sage notebook (launch via `sage -n`), and it also works in the command line (launch via `sage`), this time producing a set of .pdf files. let me mention in passing that you can use sagemath online via [sagemathcell](http://sagecell.sagemath.org/) (animate works there too) and for more serious purposes check [sagemathcloud](http://cloud.sagemath.com/).Thu, 06 Apr 2017 23:37:23 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37213#post-id-37213Comment by cybervigilante for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37211#post-id-37211It appears I have to install ImageMagick into the Virtualbox, since it won't pick it up from Windows, but I can't find how to do that yet or if it's even possible in Windows. Looks like it might work in linux, though. But then I wouldn't need a virtualbox ;)Thu, 06 Apr 2017 22:04:21 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37211#post-id-37211Comment by cybervigilante for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37210#post-id-37210I found you had to install ImageMagick (not mentioned in the tutorial - the usual dependency search ;), but still nothing is happening. FFMPEG is already installed.Thu, 06 Apr 2017 21:57:55 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37210#post-id-37210Answer by pang for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?answer=37453#post-id-37453This code will display the animation embeded in a jupyter notebook
my_path = 'my.gif'
a.gif(savefile=my_path)
html('<img src="%s" />'%my_path)
Warning: this saves the animation in the same folder where the notebook is.Fri, 28 Apr 2017 10:38:04 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?answer=37453#post-id-37453Comment by kcrisman for <p>This code will display the animation embeded in a jupyter notebook</p>
<pre><code>my_path = 'my.gif'
a.gif(savefile=my_path)
html('<img src="%s" />'%my_path)
</code></pre>
<p>Warning: this saves the animation in the same folder where the notebook is.</p>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37459#post-id-37459Re: warning - I suppose unless you made `my_path` equal to `/path/to/somewhere/else/my.gif`? (If permissions all worked cleanly.)Fri, 28 Apr 2017 14:54:27 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37459#post-id-37459Answer by cybervigilante for <p>I'm using a tutorial and should get an animation from this, but nada. All I get is the title: Animation with 20 frames, and nothing else. Is this correct or did the author miss something? I've waited ten minutes and my computer isn't That slow ;) Midrange Acer with four cores. Local server in a virtualbox on win 8. I also tried it in Firefox as well as Chrome. No change.</p>
<pre><code>f(x) = 5*x - x^2/8 + x^3/1200
df(x) = diff(f(x),x)
max = 100
p = plot(f(x),x,0,max)
lblp = text("$y = " + latex(f(x)) + "$",[40,100],fontsize=14)
lbldp = text("$y' = " + latex(df(x)) + "$",[40,80],fontsize=14,rgbcolor='#006000')
ga = []
for argx in srange(0,max,5):
dp = plot(f(argx) + (df(argx)*(x-argx)),x,0,max,color="#006000")
xp = point((argx,f(argx)),rgbcolor='#800000')
ga.append(p+lblp+lbldp+dp+xp)
animate(ga,ymin=0,ymax=max,axes_labels=['x','y'],fontsize=12,figsize=(4,3)).show(delay=1)
</code></pre>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?answer=37225#post-id-37225@mforets Animate works in sagemathcell but not sagemathcloud for me. Although I can do manual animation in cloud it breaks up due to bandwidth, so I guess sagemathcell is the best to use for a tutorial. Although the right-click dropdown doesn't work in either. But that's all icing on the cake. I can see where animation would be good in examining a dynamical system, but I'm far from having the processor speed for that anyway. Tks for the tip about sagemathcell - it's much faster than sagemathcloud.
BTW, I'm vaguely familiar with bug tickets in python but where do I go to do one in Sage?Fri, 07 Apr 2017 08:20:48 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?answer=37225#post-id-37225Comment by mforets for <p><a href="/users/8657/mforets/">@mforets</a> Animate works in sagemathcell but not sagemathcloud for me. Although I can do manual animation in cloud it breaks up due to bandwidth, so I guess sagemathcell is the best to use for a tutorial. Although the right-click dropdown doesn't work in either. But that's all icing on the cake. I can see where animation would be good in examining a dynamical system, but I'm far from having the processor speed for that anyway. Tks for the tip about sagemathcell - it's much faster than sagemathcloud.</p>
<p>BTW, I'm vaguely familiar with bug tickets in python but where do I go to do one in Sage?</p>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37236#post-id-37236Tks for the tip about sagemathcell - it's much faster than sagemathcloud. >> from a personal experience, i agree about that, but if you go on with an upgrade then it's okSat, 08 Apr 2017 08:18:05 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37236#post-id-37236Comment by mforets for <p><a href="/users/8657/mforets/">@mforets</a> Animate works in sagemathcell but not sagemathcloud for me. Although I can do manual animation in cloud it breaks up due to bandwidth, so I guess sagemathcell is the best to use for a tutorial. Although the right-click dropdown doesn't work in either. But that's all icing on the cake. I can see where animation would be good in examining a dynamical system, but I'm far from having the processor speed for that anyway. Tks for the tip about sagemathcell - it's much faster than sagemathcloud.</p>
<p>BTW, I'm vaguely familiar with bug tickets in python but where do I go to do one in Sage?</p>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37233#post-id-37233in SMC, create a new file of type "Sage Worksheet". then this example produces an embedded window with the animation. but i had to modify the speed parameter to say `delay=5` because with 1 it is super fast.Sat, 08 Apr 2017 04:57:33 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37233#post-id-37233Comment by kcrisman for <p><a href="/users/8657/mforets/">@mforets</a> Animate works in sagemathcell but not sagemathcloud for me. Although I can do manual animation in cloud it breaks up due to bandwidth, so I guess sagemathcell is the best to use for a tutorial. Although the right-click dropdown doesn't work in either. But that's all icing on the cake. I can see where animation would be good in examining a dynamical system, but I'm far from having the processor speed for that anyway. Tks for the tip about sagemathcell - it's much faster than sagemathcloud.</p>
<p>BTW, I'm vaguely familiar with bug tickets in python but where do I go to do one in Sage?</p>
http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37231#post-id-37231https://trac.sagemath.org but you'd have to sign up for an account as it is manually done to avoid spam issues.Fri, 07 Apr 2017 13:33:11 -0500http://ask.sagemath.org/question/37209/animation-doesnt-work/?comment=37231#post-id-37231