【问题标题】:Multiple Plots in MaximaMaxima 中的多个绘图
【发布时间】:2013-03-20 08:49:39
【问题描述】:

我正在用 Maxima 编写代码,我有三个情节。我可以毫无问题地单独绘制这些图,但我不知道如何将它们全部放在一个图上,而不是在一个 for 循环中进行,如果不涉及太多细节,这对我的代码来说会很困难。

    for i:1 step 1 while i<=n-1 do(figgdown[i]:plot2d(
    [discrete,[xx[i], -xx[i]],[p[i],p[i]]]));
    for i:1 step 1 while i<=n-1 do(figgup[i]:plot2d(
    [discrete,[xx[i], -xx[i]],[q[i], q[i]]]));
    for i:1 step 1 while i<=n-1 do(figgmiddle[i]:plot2d(
    [discrete,[xx[i], -xx[i]],[pq[i], pq[i]]]));

有没有一种方法可以让我在 Mathematica 中执行类似 Show 函数的操作,让图形一起出现? 最好的, 本

【问题讨论】:

    标签: plot maxima


    【解决方案1】:

    你可以保留一个列表

    n: 10;
    x: makelist(2*%pi*i/n, i, 0, n);
    
    p: [];
    y1: sin(x);
    p: endcons([discrete, x, y1], p);
    
    y2: cos(x);
    p: endcons([discrete, x, y2], p);
    
    /* display all plots in p */
    plot2d(p);
    

    【讨论】:

      【解决方案2】:

      slitvinov 的答案很好,但还有另一种选择。

      也可以使用multiple plot option from draw。然后你有一个带有少量子图的图像(情节),每个场景都有自己的轴和标题:

      绘制(场景1,场景2,场景3)

      这里是an example with code

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-05-31
        • 2023-03-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-06
        相关资源
        最近更新 更多