# Redrawing and Combining Plots

*Mathematica* saves information about every plot you produce, so that you can later redraw it. When you redraw plots, you can change some of the options you use.

Show[plot,option->value] | redraw a plot with options changed |

Show[plot_{1},plot_{2},...] | combine several plots |

GraphicsGrid[{{plot_{1},plot_{2},...},...}] | draw an array of plots |

InputForm[plot] | show the underlying textual description of the plot |

Functions for manipulating plots.

Out[1]= | |

When you redraw the plot, you can change some of the options. This changes the choice of

scale.

Out[2]= | |

This takes the plot from the previous line, and changes another option in it.

Out[3]= | |

By using

Show with a sequence of different options, you can look at the same plot in many different ways. You may want to do this, for example, if you are trying to find the best possible setting of options.

You can also use

Show to combine plots. All of the options for the resulting graphic will be based upon the options of the first graphic in the

Show expression.

This sets

to be a plot of

from

to

.

Out[4]= | |

Here is a plot of

from

to

.

Out[5]= | |

Out[6]= | |

This uses

PlotRange to override the explicit value set for

.

Out[7]= | |

All

*Mathematica* graphics are expressions and can be manipulated in the same way as any other expression. Doing these kinds of manipulations does not require the use of

Show.

This replaces all instances of the symbol

Line with the symbol

Point in the graphics expression represented by

.

Out[8]= | |

Using

Show you can combine several plots into one.

GraphicsGrid allows you to draw several plots in an array.

GraphicsGrid[{{plot_{11},plot_{12},...},...}] | draw a rectangular array of plots |

GraphicsRow[{plot_{1},plot_{2},...}] | draw several plots side by side |

GraphicsColumn[{plot_{1},plot_{2},...}] | draw a column of plots |

GraphicsGrid[plots,Spacings->{h,v}] | put the specified horizontal and vertical spacing between the plots |

Drawing arrays of plots.

This shows the previous plots in an array.

Out[9]= | |

If you redisplay an array of plots using

Show, any options you specify will be used for the whole array, rather than for individual plots.

Out[10]= | |

GraphicsGrid by default puts a narrow border around each of the plots in the array it gives. You can change the size of this border by setting the option

Spacings. The parameters

h and

v give the horizontal and vertical spacings to be used. The

Spacings option uses the width and height of characters in the default font to scale the

h and

v parameters by default, but it is generally more useful in graphics to use

Scaled coordinates.

Scaled scales widths and heights so that a value of

represents the width and height of one element of the grid.

This increases the horizontal spacing, but decreases the vertical spacing between the plots in the array.

Out[11]= | |

When you make a plot,

*Mathematica* saves the list of points it used, together with some other information. Using what is saved, you can redraw plots in many different ways with

Show. However, you should realize that no matter what options you specify,

Show still has the same basic set of points to work with. So, for example, if you set the options so that

*Mathematica* displays a small portion of your original plot magnified, you will probably be able to see the individual sample points that

Plot used. Options like

PlotPoints can only be set in the original

Plot command itself. (

*Mathematica* always plots the actual points it has; it avoids using smoothed or splined curves, which can give misleading results in mathematical graphics.)

Out[12]= | |

This shows a small region of the plot in a magnified form. At this resolution, you can see the individual line segments that were produced by the original

Plot command.

Out[13]= | |