First, view the array MARBELLS_BINARY.A as a three-dimensional, wire-mesh surface. Use the CONGRID procedure initially to resample the data set so that the mesh can be displayed at a size visible to the human eye.maroon_bells=read_binary('/usr/local/rsi/idl_5.4/idl_5.4/examples/data/surface.dat',$
data_dims=[350,450],data_type=2,endian='little')
1. Here resample the array size to 35 by 45, or one tenth its original size. To do this enter:a=congrid(maroon_bells,35,45)2. Now we are ready to visualize the mesh using the SURFACE command:surface,a

3. View the array from a different angle by entering the following command:surface,a, ax=70, az=25

1. First, load one of the pre-defined IDL color tables by entering:loadct, 32. To view the light-source shaded surface, shown in the following, simply enter the command:shade_surf,a

3. To look at the array from another angle, enlarge the label text, and add a title. Again, keywords are used to control certain features of the shaded surface plot. The AX and AZ keywords control the viewing angle, just as they did with the SURFACE command. The CHARSIZE keyword controls the size of plotted text. The TITLE keyword was used to add the title Shaded Surface Representation.shade_surf,a,ax=45,az=20,charsize=1.5, $
title='Shaded Surface Representation'

4. You can create a different kind of shaded surface, where the shading information is provided by the elevation of each point. Now different shading colors on the plot correspond to different elevations (the BYTSCL function scales the data values into the range of bytes). You could also specify a different array for the shading colors.shade_surf,a,shade=bytscl(a)

5. You can plot a wire-frame surface of the Maroon Bells (mountains) right over the existing plot. The XSTYLE, YSTYLE, and ZSTYLE keywords are used to select different styles of axis. Here, SURFACE is set to not draw the X, Y, and Z axis because they were already drawn by the SHADE_SURF command. The /NOERASE keyword allows the SURFACE plot to be drawn over the existing SHADE_SURF plot. Enter the following:surface,a,xstyle=4,ystyle=4,zstyle=4,/noerase

1. Set the array size back to its original 350 by 450 size by entering:a=maroon_bells2. Plot the contour:contour,a

That command was very simple, but the resulting plot was not as informative as it could be.
3. Create a customized CONTOUR plot with more elevations and labels by entering:contour,a,nlevels=8,c_labels=[0,1]

By using the NLEVELS keyword, CONTOUR was told to plot eight equally-spaced elevation levels. The C_LABELS keyword specifies which contour levels should be labeled. By default, every other contour is labeled. C_LABELS allows you to override this default and explicitly specify the levels to label.
4. Similarly, you can create a filled contour plot where each contour level is filled with a different color (or shade of gray) by setting the FILL keyword. To do this, enter:contour,a,nlevels=8,/fill

5. To outline the resulting contours, make another call to CONTOUR and set the OVERPLOT keyword to keep the previous plot from being erased. You can add tickmarks that indicate the slope of the contours (the tickmarks point in the downhill direction) by setting the DOWNHILL keyword:contour,a,nlevels=8,/overplot,/downhill

6. CONTOUR plots can be rendered from a three-dimensional perspective. First, set up the default 3-D viewing angle by entering:surfr7. By using the T3D keyword in the next call to CONTOUR, the contours will be drawn as seen from a 3-D perspective. Enter:contour,a,nlevels=8,/t3d

1. Create a plot that shows a two-dimensional array as an image, wire-frame surface, and contour simultaneously.show3,a

1. Here, to visualize a surface representation, enter the following:live_surface,a

| This information is available in alternative formats upon request by individuals with disabilities. Please send email to alt-format@msi.umn.edu or call 612-624-0528. | ||||||||||||
|
HOME |
QUESTIONS |
FEEDBACK
|
||||||||||||
|
||||||||||||