Contour Plots

You can create surface plots of your data using the CONTOUR and ICONTOUR procedures. Keywords to these routines allow you to add titles, change the range and type of axes used, and customize your plots in other ways. This section describes:

Creating Contour Plots with CONTOUR

The call to CONTOUR establishes the plot window (the rectangular area enclosed by the axis), the plot region (the box enclosing the plot window and its annotation), the axis types (linear or logarithmic), and the scaling. Data variables are then plotted within the plot window.

To create a simple contour representation of elevation data, do the following:

  1. Restore the marbells.dat file, creating an array variable named elev:
  2. RESTORE, FILEPATH('marbells.dat', SUBDIRECTORY=['examples', 'data'])

  3. Resample the elev variable. The CONGRID function creates a 35 by 45 element array from the original 350 by 450 element array); this will make the grid easier to see in our surface visualization.
  4. marbells = CONGRID(elev, 35, 45)

  5. Call the SURFACE procedure:
  6. CONTOUR, marbells


    marbell_contour1.gif

Creating Contour Plots with ICONTOUR

The ICONTOUR procedure uses the IDL iTools framework to display contour plots in an interactive window rather than as a static display. To replicate the above example using ICONTOUR and the full elev dataset:

ICONTOUR, elev


marbell_contour2.gif

Creating a Composite Plot with SHOW3

The SHOW3 procedure combines a contour plot, a surface plot, and an image in a single display:

SHOW3, marbells


marbell_contour3.gif

Further Information

For additional information on contour plotting, see