Previous Getting Started with IDL: Plotting Irregularly Gridded Data Next

Plotting the Results with TRIGRID

Now that we have the triangulation TR, the TRIGRID function can be used to return a regular grid of interpolated Z values.

  1. Display a surface plot of the gridded data by passing the result of the TRIGRID function to SURFACE, using the default interpolation technique and add a title to the plot, shown below, by entering:
  2. SURFACE,TRIGRID(X,Y,Z,TR)  
    XYOUTS,.5,.9,'Linear Interpolation',ALIGN=.5,/NORMAL  
    

     

    Figure 10-3: Linear interpolation of triangulated data

    Figure 10-3: Linear interpolation of triangulated data

     

    The TRIGRID function can also return a smoothed interpolation. Set the QUINTIC keyword to use a quintic polynomial method when interpolating the grid.

     

  3. Display the results of the quintic gridding method, shown below, by entering:
  4. SURFACE,TRIGRID(X,Y,Z,TR,/QUINTIC XYOUTS, .5,.9,'Quintic 
    Interpolation',ALIGN=.5,/NORMAL  
    

     

    Figure 10-4: Quintic interpolation of triangulated data

    Figure 10-4: Quintic interpolation of triangulated data

  IDL Online Help (March 06, 2007)