PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
264 stars 205 forks source link

Featrure request : animated plots from sagemath #1748

Open JCBustamante opened 2 years ago

JCBustamante commented 2 years ago

Hello all, I woukd lke to be able to include animated plots, produced, for instance, with sagemath. I tried the code below, (and some mild variations, like a.apng() at the end) in a very naive attempt. Of course it did not work, from the error message I conclude that a .svg image was expected. This is not the only way to produce animated plots with sage, though. Also, let me point out that I do not want an interact.

Une animation x = SR.var("x") sines = [plot(c*sin(x), (-2*pi,2*pi), color=Color(c,0,0), ymin=-1, ymax=1) for c in sxrange(0,1,.2)] a = animate(sines) a
rbeezer commented 2 years ago

How will this behave in a PDF?

On June 19, 2022 3:10:54 PM EDT, JCBustamante @.***> wrote:

Hello all, I woukd lke to be able to include animated plots, produced, for instance, with sagemath. I tried the code below, (and some mild variations, like a.apng() at the end) in a very naive attempt. Of course it did not work, from the error message I conclude that a .svg image was expected. This is not the only way to produce animated plots with sage, though. Also, let me point out that I do not want an interact.

Une animation x = SR.var("x") sines = [plot(c*sin(x), (-2*pi,2*pi), color=Color(c,0,0), ymin=-1, ymax=1) for c in sxrange(0,1,.2)] a = animate(sines) a
rbeezer commented 2 years ago

Didn't realize this was on GH (traveling).

@JCBustamante - this would be better on -dev. Can you restart there?