Previous iTool User's Guide: Working with Plots Next

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 13-4: Sin Wave Data Plotted

    Figure 13-4: Sin Wave Data Plotted

     

  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 13-5: Cosine Data Overplotted on Sine Data

    Figure 13-5: Cosine Data Overplotted on Sine Data

  IDL Online Help (March 01, 2006)