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:
  2. theory = SIN(2.0*FINDGEN(200)*!PI/25.0)*EXP(-0.02*FINDGEN(200)) 
    
  3. Plot theory using iPlot:
  4. iPlot, theory  
     

    Figure 14-4: Sin Wave Data Plotted

    oplot1.gif

  5. Create a variable named "newtheory" which stores cosine data to be used for overplotting:
  6. newtheory = COS(2.0*FINDGEN(200)*!PI/25.0)*EXP(-0.02*FINDGEN(200)) 
    
  7. Now overplot the new cosine data onto your original plot:
  8. iPlot, newtheory, /OVERPLOT 
     

    Figure 14-5: Cosine Data Overplotted on Sine Data

    oplot2.gif

Note
For information on how to display plots and overplots using the Visualization Palette, see Plot Visualizations.