如何在Mathematica中的一张图片中绘制几幅图形?

时间:2011-07-10 15:30:45

标签: matlab wolfram-mathematica

就像Matlab中的hold on一样 当我想在一张照片中画几行时,我遇到了这个问题 线数各不相同。

4 个答案:

答案 0 :(得分:9)

Mathematica有很多结构可以让你结合图形,图形和图像 我会举几个例子。您可以搜索帮助系统以了解更多信息,并了解以下示例的细微之处:

enter image description here

修改

如果您想从/向文件进行读/写,以下代码可以作为入门指南:

(*Create data*)
data = RandomReal[1, {8, 2}];
(*Put into a file*)
Export["c:\\test.tab", data, "Table"];
(*Read the file into another list*)
rdat = Import["c:\\test.tab", "Table"];
(*And Plot it like before*)
Graphics[{Line@#, Red, PointSize[Large], Point /@ #} &@rdat]

enter image description here

答案 1 :(得分:5)

Mathematica 8引入了一个新的通用函数Overlay,可用于以图形方式覆盖任何类型的表达式:

Overlay[{Graphics[{Yellow, Disk[]}], "Sun"}]

答案 2 :(得分:4)

使用Show组合图形对象。

Show[Plot[Sin[x],{x,0,10}], Plot[Cos[x],{x,0,10}]]

编辑如果你想绘制几行,那么用几行来构建你的Graphics对象:

Graphics[ Table[ Line[{{0,0}, {Cos[x],Sin[x]}}], {x,0,Pi,Pi/10} ] ]

答案 3 :(得分:1)

结合图形基元,如Szabolcs所说:

  

图形[表[行[{{0,0},{Cos [x],Sin [x]}}],{x,0,Pi,Pi / 10}]]

但是如果你正在使用情节,那么你需要做的是:

Show[Table[Plot[A Sin[x],{x,0,2 Pi}],{A,0.1,10}]]

显示命令允许您组合图形表生成不同的A,其中每一个都是一个超过x的绘图。

相关问题