Just like hold on
in Matlab.
Mathematica has a lot of constructs allowing you to combine plots, graphics and images.
I'll give you several examples. You can search the help system to find out more and understand the subtleties of the examples bellow:
Edit
If you want to read/write from/to files, the following code may serve you as a starting guide:
(*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]
Mathematica 8 introduced a new versatile function Overlay, which can be used to graphically overlay any type of expression:
Overlay[{Graphics[{Yellow, Disk[]}], "Sun"}]
Use Show
to combine graphics objects.
Show[Plot[Sin[x],{x,0,10}], Plot[Cos[x],{x,0,10}]]
EDIT If you want to draw several lines, then build your Graphics
object out of several lines:
Graphics[ Table[ Line[{{0,0}, {Cos[x],Sin[x]}}], {x,0,Pi,Pi/10} ] ]
combine graphics primitives like Szabolcs said:
Graphics[ Table[ Line[{{0,0}, {Cos[x],Sin[x]}}], {x,0,Pi,Pi/10} ] ]
but if you are using plot then what you need to do is:
Show[Table[Plot[A Sin[x],{x,0,2 Pi}],{A,0.1,10}]]
Show command allows you to combine the graphics Table produces varying A, each one of them a Plot over x.
精彩评论