2011-05-30 17 views

回答

17

你可以像这样与Show功能相结合的任何图形:

Show[myListPlot, myPlot] 

这可以推广到一次组合任意数量的地块:Show[p1, p2, p3, p4, ...]Show[{p1,p2,p3,p4,...}]


参考文献e和图片来源:http://reference.wolfram.com/mathematica/ref/Show.html

enter image description here

enter image description here


您可以使用Epilog,以及如果Show不堆积在正确的顺序显卡,但超过2个显卡采用结语结合会笨拙。

+0

解决!谢谢! – BlackShadow 2011-05-30 20:23:45

+2

我不明白你的最后一行......小心解释为什么'Epilog'太过分了或者你的意思是“堆叠顺序”? – 2011-05-30 21:38:51

+1

您应该将评论张贴到其他答案作为评论有几个原因,不是不那么重要的是,目前的答案可以在将来删除,其他人可以发布 – 2011-05-30 21:41:03

9

从您的第二行开始,我认为Epilog就是您要查找的内容。这里有一个例子:

f[x_] := 1/Sqrt[2 Pi] Exp[-(x^2)/2]; 
ListPlot[ 
Table[ 
    {x, PDF[NormalDistribution[], x]}, {x, -4, 4, 0.1} 
    ], 
Epilog -> [email protected][f[x], {x, -4, 4}, PlotStyle -> Red] 
] 

enter image description here

另一种方式做同样是使用Show

p1 = ListPlot[ 
    Table[ 
    {x, PDF[NormalDistribution[], x]}, {x, -4, 4, 0.1} 
    ] 
    ]; 
p2 = Plot[f[x], {x, -4, 4}, PlotStyle -> Red]; 
Show[p1,p2] 

在另一方面,如果我错了,你只是想把它们合并成一个接一个,然后你可以使用GraphicsRowGraphicsColumn

[email protected][{p1, p2}] 

enter image description here