Displaying Surfaces with Direct Graphics
Working with images using Direct graphics is not as convenient as using the iImage tool, but may be desirable if you are incorporating images into a larger widget-based application, or if you need to programatically create a large number of processed images.
In this example, we will display three-dimensional surface data using IDL Direct graphics. Enter the following commands at the IDL command line:
- If you have not already done so, restore the
marbells.datSAVE file. - Since we are using Direct graphics, tell IDL to use a maximum of 256 colors and load a simple grayscale color map.
- Use the CONGRID procedure to resample the data set so that the grid can be displayed at a visible size. In this case, resample the array size to 35 x 45, or one-tenth its original size.
- Visualize the grid.
RESTORE, FILEPATH('marbells.dat', $
SUBDIRECTORY=['examples', 'data'])
DEVICE, RETAIN=2, DECOMPOSED=0
LOADCT, 0

The SURFACE procedure can be used to view your data from different angles. The AX keyword specifies the surface angle of rotation (in degrees towards the viewer) about the X axis. The AZ keyword specifies the surface rotation in degrees, counterclockwise about the Z axis.
