无法使用with_slider_draw()生成动画gif

发布于 2025-02-04 12:08:00 字数 1413 浏览 0 评论 0原文

在OSX 13.6/15.7上使用wxmaxima v19.05.7我没有问题使用 with_slider()创建动画gif。例如,

with_slider(
   t,
   makelist(i,i,0,%e,0.05),
   [sin(x+t), cos(x+t)], [x,0,5]
)$

按预期工作。但是,如果我想用_slider_draw()绘制函数图,

with_slider_draw(
    t,
    makelist(i,i,0,%e,0.05),
    explicit(sin(x+t),x,0,5)
)$e

我会收到错误消息,例如:

Wxmaxima Error
cant't open file '~/tmp/maxout_4856_55.png'
Error 2. No such file or directory.

wxmaxima中的inline图形的位置,说

Error: cannot render ~/tmp/maxout_4856_55.png

确实没有 maxout_4856_ [01-- 55] .png-files in〜/tmp/。相应的gnuplot文件 data4856.gnuplot maxout4856.gnuplot

这里出了什么问题?

  1. 为什么图形文件?
  2. 为什么wxmaxima要求 png -files?

任何帮助都赞赏。

Cheers,Tilda


编辑:我通过在 set_draw_defaults()中重置终端来解决

set_draw_defaults(
     line_width = 2, 
     dimensions = [640,384],
       terminal = pngcairo
)$
with_slider_draw(
t,
makelist(i,i,0,%e,0.05),
   color = steelblue4,
explicit(sin(x+t),x,0,5),
   color = red3,
explicit(cos(x+t),x,0,5)
)$

问题然后可以将其导出为动画gif:

动画

上面的

Using wxMaxima v19.05.7 on osx 13.6/15.7 I have no problems creating animated gifs using with_slider(). E.g.

with_slider(
   t,
   makelist(i,i,0,%e,0.05),
   [sin(x+t), cos(x+t)], [x,0,5]
)$

works as expected. However, if I want to plot the function graphs with with_slider_draw()

with_slider_draw(
    t,
    makelist(i,i,0,%e,0.05),
    explicit(sin(x+t),x,0,5)
)$e

I get error messages like:

Wxmaxima Error
cant't open file '~/tmp/maxout_4856_55.png'
Error 2. No such file or directory.

and the place-holder for the inline graphics within wxMaxima saying

Error: cannot render ~/tmp/maxout_4856_55.png

There are indeed no maxout_4856_[01-55].png-files in ~/tmp/ . The corresponding gnuplot files data4856.gnuplot and maxout4856.gnuplot however are produced.

What is going wrong here?

  1. Why are no graphic files produced?
  2. Why does wxMaxima ask for png-files?

Any help appreciated.

Cheers, Tilda


Edit: I managed to solve the problem by resetting the terminal in set_draw_defaults() So,

set_draw_defaults(
     line_width = 2, 
     dimensions = [640,384],
       terminal = pngcairo
)$
with_slider_draw(
t,
makelist(i,i,0,%e,0.05),
   color = steelblue4,
explicit(sin(x+t),x,0,5),
   color = red3,
explicit(cos(x+t),x,0,5)
)$

produces the desired with_slider_draw()-animation inline that can then be exported as an animated gif:

Animation of the above plot

Cheers, Tilda

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文