| iTool User's Guide: Working with Plots |

## Overplotting

Once you have plotted data, you may overplot new plot data in the original iPlot window. Overplotting is the process of plotting new data over the top of original data or datasets for the purpose of analyzing or comparing more than one dataset at a time.

For example, in order to overplot cosine data onto a plot of sine wave data follow these steps:

1. Create a variable named "theory" to contain sine wave data to be plotted:

    theory = SIN(2.0*FINDGEN(200)*!PI/25.0)*EXP(-0.02*FINDGEN(200))

2. Plot theory using iPlot:

    iPlot, theory

Figure 13-4: Sin Wave Data Plotted

Figure 13-4: Sin Wave Data Plotted

3. Create a variable named "newtheory" which stores cosine data to be used for overplotting:

    newtheory = COS(2.0*FINDGEN(200)*!PI/25.0)*EXP(-0.02*FINDGEN(200))

4. Now overplot the new cosine data onto your original plot:

    iPlot, newtheory, /OVERPLOT

Figure 13-5: Cosine Data Overplotted on Sine Data

Figure 13-5: Cosine Data Overplotted on Sine Data

IDL Online Help (March 01, 2006)