Maxima plotting in a loop, must shut one plot to see the next one

女生的网名这么多〃 提交于 2019-12-11 06:53:53

问题


Maxima plotting in a loop, must shut one plot to see the next one. Iam working in windows environment, but in linux will the function plotted in one view.

For example this function :

for d:0.1 thru 1 step 0.1 do
  draw2d(explicit(x^d,x,0,1));

I have also tried this:

set_plot_option(['plot_format, 'gnuplot_pipes]);

But this didnt solve it. Is there an option, where i can set the plotting in one view?

Thank you.


回答1:


You could make a list of curves in the loop and plot them all on a single graph. You can use a loop or makelist to build the curve list.

makelist(x^d, d, 0, 1, 0.1);
plot2d(%, [x, 0, 1]);

If you're using wxMaxima, you can the with_slider_draw function to animate the plot:

with_slider_draw(
    d, /* the name of the variable to attach to the slider */
    makelist(i,i,0,1,0.1), /* a list of values that the variable can have */
    explicit(x^d, x, 0, 1) /* plot the function */
)$

If you prefer plot2d arguments, use with_slider to do the same thing:

with_slider(
   d,
   makelist(i,i,0.1,1,0.1),
   [x^d], [x,0,1]
);

Click on the graph and then use the Play button on the toolbar to play the animation. You can use the slider on the toolbar or your mouse wheel to move back and forth between animation frames. You can even save the animation as an animated gif by right-clicking the plot and choosing Save Animation.



来源:https://stackoverflow.com/questions/27567331/maxima-plotting-in-a-loop-must-shut-one-plot-to-see-the-next-one

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!