Displaying Contours

You can easily create contour visualizations using the Tool Palette in the IDL Visualize perspective or from the command line with the ICONTOUR command. Either way, the visualization displays in the IDL iContour tool, which allows you to visualize, modify, and manipulate two-dimensional contour data in an interactive environment.

Displaying Contours in the Tool Palette

contour_1.gif

In this example, we use the RESTORE procedure, which loads IDL variables and routines into memory that were previously saved to a file by the SAVE procedure.

  1. If you have not already done so, restore the marbells.dat SAVE file.
  2. RESTORE, FILEPATH('marbells.dat', $
    SUBDIRECTORY=['examples', 'data'])

    By restoring marbells.dat, the array variable ELEV is loaded into memory, and displays in the Variables view in the Workbench.

  3. Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (viz_button.gif) in the upper right of the Workbench.)
  4. From the Variables View, drag the ELEV variable to the Contour icon in the Tool Palette.

Displaying Contours Using iContour

You can create the visualization shown in the previous section using the ICONTOUR command from the IDL command line.

  1. Restore the marbells.dat SAVE file, as described above.
  2. Load the data into the iContour tool and display it.
  3. ICONTOUR, elev

  4. To create filled contours:
    contour_9.gif
  5. ICONTOUR, elev, /FILL, $
       RGB_TABLE=0, N_LEVELS=10

Modifying Contours

The iContour tool allows you to manipulate and modify displayed contours. For example, you can add a legend that shows the contour levels.

To add a legend, from iContour select Insert New Legend. Double-click on the legend to display a dialog that allows you to modify the legend contents.

You might, for example, change the legend title, hide contour levels, or change the text style. For more information on working with the iContour tool, see Working with Contours.

contour_2.gif