# make a single figure composed of several plot

I've to make a single figure composed of several plot but I can't do it. Can anyone help me?
Thank you all

• Have a look at GraphicsGrid. Mar 25 at 8:34
• Or Show[plotone,plottwo], to have plotone and plottwo overlaid instead of side by side
– Adam
Mar 25 at 9:37
• PlotGrid is certainly the way to go. GraphicsGrid is LESS/NOT recommended. Mar 25 at 9:39
• Done! thank you all Mar 25 at 17:16

## 1 Answer

I would suggest two methods:

Show[{
Plot[Cos[2 x], {x, 0, 4 \[Pi]}, PlotStyle -> Blue],
Plot[Sin[x], {x, 0, 2 \[Pi]}, PlotStyle -> Red]
}]


or even more simply

Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]}]


Note that when you use Show, you simply put plots together. The axes are automatically defaulting to the parameters of the first graph you have added. Here I created a plot that has a smaller range than the other to demonstrate the effect. Had you reversed the order in the Show, then you'd crop the second function.

Putting all your functions under the same plot simplifies some of that and automatically colours them for you, but the evaluation parameters for x {x,min,max} is common for all of them.

I hope that helps!

• When putting multiple functions in a single Plot you can use one or more ConditionalExpressions to use different plot ranges, e.g., Plot[{ConditionalExpression[Sin[x], 0 < x < 2 Pi], ConditionalExpression[Cos[x], Pi < x < 4 Pi]}, {x, 0, 4 Pi}] Mar 25 at 13:52
• That is a really good point! Thought to keep it simple to begin with. Is that generally better than simply having two plots with distinct ranges?
– alex
Mar 25 at 16:18
• Depends on what you are trying to show/emphasize. You will need to judge what is better. Mar 25 at 17:21