SHOW3 Procedure

The SHOW3 procedure combines an image, a surface plot of the image data, and a contour plot of the images data in a single tri-level display.

This routine is written in the IDL language. Its source code can be found in the file show3.pro in the lib subdirectory of the IDL distribution.

Syntax

SHOW3, Image [, X, Y] [, /INTERP] [, E_CONTOUR=structure] [, E_SURFACE=structure] [, SSCALE=scale]

Arguments

Image

The two-dimensional array to display.

X

A vector containing the X values of each column of Image. If the X argument is omitted, columns have values 0, 1, ..., ncolumns-1.

Y

A vector containing the Y values of each row of Image. If the Y argument is omitted, rows have values 0, 1, ..., nrows-1.

Keywords

INTERP

Set this keyword to use bilinear interpolation on the pixel display. This technique is slightly slower, but for small images, it makes a better display.

E_CONTOUR

Set this keyword equal to an anonymous structure containing additional keyword parameters that are passed to the CONTOUR procedure. Tag names in the structure should be valid keyword arguments to CONTOUR, and the values associated with each tag should be valid keyword values.

E_SURFACE

Set this keyword equal to an anonymous structure containing additional keyword parameters that are passed to the SURFACE procedure. Tag names in the structure should be valid keyword arguments to SURFACE, and the values associated with each tag should be valid keyword values.

SSCALE

Reduction scale for surface. The default is 1. If this keyword is set to a value other than 1, the array size is reduced by this factor for the surface display. That is, the number of points used to draw the wire-mesh surface is reduced. If the array dimensions are not an integral multiple of SSCALE, the image is reduced to the next smaller multiple.

Examples

; Create a dataset:
A = BESELJ(SHIFT(DIST(30,20), 15, 10)/2.,0)

; Show it with default display:
SHOW3, A

; Specify X axis proportional to square root of values:
SHOW3, A, SQRT(FINDGEN(30))

; Label CONTOUR lines with double size characters, and include
; downhill tick marks:
SHOW3, A, E_CONTOUR={C_CHARSIZE:2, DOWN:1}

; Draw a surface with a skirt and scale Z axis from -2 to 2:
SHOW3, A, E_SURFACE={SKIRT:-1, ZRANGE:[-2,2]}

Combining Images with Three-Dimensional Graphics

Images are combined with three-dimensional graphics, as shown in the figure below, using the transformation techniques described above.

The rectangular image must be transformed so that it fits underneath the mesh drawn by SURFACE. The general approach is as follows:

X = S0,0 + S1,0U +S1,0V +S1,1UV

Y = T0,0 + T1,0U + T1,0V + T1,1UV

We solve for the four unknown S coefficients using the four equations relating the x corner coordinates to their U coordinates. The T coefficients are similarly found using the y and V coordinates. This can be done using matrix operators and inversion or more simply, with the procedure POLY_WARP.

(MAX(U) – MIN(U) +2, MAX(V) – MIN(V) +1)

The SHOW3 procedure performs these operations. It should be examined for details of how images and graphics can be combined.

The following IDL commands were used to create the previous image:

; Restore variables:
@cntour01
; Create an array of levels for CONTOUR:
levs = (FINDGEN(10)*100)+3500
; Use SHOW3. Note the use of keywords E_SURFACE ; and E_CONTOUR to pass values to the SURFACE and ; CONTOUR routines used within SHOW3.
SHOW3, elev, E_SURFACE={min:2000}, E_CONTOUR={levels:levs}

Version History

Original

Introduced

See Also

CONTOUR Procedure, SURFACE Procedure