Mathematica lets you store plots in variables so that you can combine several individual plots in a composite figure. Enter

and you will get two individual plots of the sine and cosine function. To plot both functions on the same set of axes, entersplot = Plot[ Sin[x], {x, 0, 2 Pi} ]cplot = Plot[ Cos[x], {x, 0, 2 Pi} ]

You can combine different types of plots in this fashion. For example, you might want to combine a plot of experimental data points with a plot of a curve that fits through these points. The data points could be plotted with aShow[splot, cplot]

Sometimes you will generate a plot, and after looking at it,
decide that you want to save it in a variable so that you
can combine it with another plot. To do this, you can use
the **%** shortcut we already mentioned. For example,

will store the plotted sine curve in the variablePlot[ Sin[x], {x, 0, 2 Pi} ]splot = %

The **Show** command will combine several plots at once:

Or you can combine the plots in stages:splot = Plot[ Sin[x], {x, 0, 2 Pi} ]cplot = Plot[ Cos[x], {x, 0, 2 Pi} ]tplot = Plot[ Tan[x], {x, 0, 2 Pi} ]Show[splot, cplot, tplot]

splot = Plot[ Sin[x], {x, 0, 2 Pi} ]cplot = Plot[ Cos[x], {x, 0, 2 Pi} ]sandc = Show[splot, cplot]tplot = Plot[ Tan[x], {x, 0, 2 Pi} ]Show[sandc, tplot]

When you combine two or more plots, you may want to adjust
the limits of the x and y axes to focus attention on a
particular region of the plot. The **PlotRange** modifier
to the **Show** command lets you do this. Enter

This tells Mathematica to extend the horizontal axis so that it includes the range 0 < x < 10 and the vertical axis so that it includes the range -10 < y < 10. The general format for theShow[splot, cplot, tplot,PlotRange -> { {0, 10}, {-10, 10} }]

You can see that the range is specified as a nested list, butPlotRange -> { { <Xmin>, <Xmax> }, { <Ymin>, <Ymax> } }

Note that when we changed the axis limits, Mathematica did
not extend the plots across the entire x axis. If you want
the curves to extend all the way to x = 10, you need to
specify this in the original **Plot** commands:

splot = Plot[ Sin[x], {x, 0, 10} ]cplot = Plot[ Cos[x], {x, 0, 10} ]tplot = Plot[ Tan[x], {x, 0, 10} ]Show[splot, cplot, tplot,PlotRange -> { {0, 10}, {-10, 10} }]

Other parts of the Mathematica tutorial:

- Mathematica's user interface
- Simple calculations
- Plotting lists of points
- Plotting functions
- Fitting data to polynomials
- Generating and manipulating lists of numbers
- Complex numbers
- Derivatives and integrals
- Special functions
- Contour and surface plots