Surface Plots

You can create surface plots of your data using the SURFACE and ISURFACE 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 Surface Plots with SURFACE

The call to SURFACE 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 surface 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. SURFACE, marbells


    marbell_surface1.gif

Axis Orientation

You can modify the orientation of the axes using AX and AZ keywords to SURFACE. For example, the following command rotates the X-Y plane of the plot to 60 degrees from horizontal, and rotates the Y-Z plane of the plot to 20 degrees from straight toward the viewer:

SURFACE, marbells, AX=60, AZ=20


marbell_surface2.gif

Shaded Surfaces

To create a shaded surface, use the SHADE_SURF procedure. SHADE_SURF and its parameters are similar to SURFACE, but it renders the visible surface as a shaded image rather than a mesh.

For example, to create a light-source shaded surface:

SHADE_SURF, marbells, AZ=20, CHARSIZE=1.5, $
TITLE='Light-source Shaded Surface'


marbell_surface3.gif

Creating Surface Plots with ISURFACE

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

ISURFACE, elev


marbell_surface4.gif

Note that ISURFACE creates a shaded surface by default. To create a wire mesh surface similar to that drawn by the SURFACE routine, double-click on the surface to display the property sheet and "Wire Mesh" as the Surface Style. Alternately, use the STYLE keyword to ISURFACE:

ISURFACE, marbells, STYLE=1

(Here, we used the reduced data set to make it easier to see the mesh lines.) Note that you can rotate the surface interactively by selecting the Rotate manipulator.

marbell_surface5.gif

Further Information

For additional information on surface plotting, see