The SURFACE function draws a three-dimensional surface for a two-dimensional array of data.
Instead of data, you can also input an equation of X and Y using either the input argument or the EQUATION property. In this case IDL will automatically generate the independent X and Y values and use your equation to compute the dependent Z data.
Example
The following lines create the graphic shown at the top of this topic.
dir = FILEPATH('',SUBDIR=['examples', 'data'])
z = READ_BINARY(dir+'elevbin.dat', DATA_DIMS=[64,64])
READ_JPEG, dir+'elev_t.jpg', image
s = SURFACE(z, TEXTURE_IMAGE=image, YSTYLE=1)
Additional Examples
See Surface, contour, and vector examples for additional examples using the SURFACE function.
Syntax
graphic = SURFACE(Data [, X, Y] [, Keywords=value] [, Properties=value])
Keywords
Keywords are applied only during the initial creation of the graphic.
AXIS_STYLE=value
/BUFFER, /CURRENT, /DEVICE, DIMENSIONS=[width, height], LAYOUT=array, LOCATION=[x, y], MARGIN=scalar or [left, bottom, right, top], /NO_TOOLBAR, /NODATA, /OVERPLOT, /WIDGETS
/IRREGULAR
TEXTURE_IMAGE=array
Properties
Properties can be set as keywords to the function during creation, or retrieved or changed using the "." notation after creation.
ANTIALIAS, ASPECT_RATIO, ASPECT_Z, AXES, BACKGROUND_COLOR, BACKGROUND_TRANSPARENCY, BOTTOM_COLOR, CLIP, COLOR, CROSSHAIR, DEPTH_CUE, EQN_SAMPLES, EQN_USERDATA, EQUATION, EYE, FONT_COLOR, FONT_NAME, FONT_SIZE, FONT_STYLE, GRID_UNITS, HIDDEN_LINES, HIDE, LINESTYLE, MAX_VALUE, MIN_VALUE, NAME, PERSPECTIVE, POSITION, RGB_TABLE, SHADING, SHOW_SKIRT, SKIRT, STYLE, TEXTURE_INTERP, THICK, TITLE, TRANSPARENCY, UVALUE, VERT_COLORS, WINDOW, WINDOW_TITLE, XRANGE, YRANGE, ZCLIP, ZRANGE
Methods
Close
ConvertCoord
CopyWindow
Delete
Erase
GenerateCode
GetData
GetValueAtLocation
MapForward
MapInverse
Order
Print
Refresh
Rotate
Save
Scale
Select
SetData
Translate
Return Value
The SURFACE function returns a reference to the created graphic. Use the returned reference to manipulate the graphic after creation by changing properties or calling methods.
Arguments
Data
A vector or two-dimensional array containing the surface heights. If Data is a vector, then X and Y should also be vectors of the same length, containing the x and y coordinate of the corresponding points.
X
A vector or 2D array containing the x-coordinates of the data.
If Data is a 2D array and X is a vector, then each element of X specifies the x-coordinate for a column of Data.
If X is a two-dimensional array, then each element specifies the x-coordinate of the corresponding point in Data.
Y
A vector or 2D array containing the y-coordinates of the data.
If Data is a 2D array and Y is a vector, then each element of Y specifies the y-coordinate for a row of Data.
If Y is a two-dimensional array, then each element specifies the y-coordinate of the corresponding point in Data.
Automatic Gridding
If Data, X, and Y are vectors with the same number of elements, then the data is assumed to be irregularly spaced. If Data, X, and Y are two-dimensional arrays with the same number of elements, then the X and Y coordinates will be tested to determine if the points are regularly or irregularly spaced.
In either case, if the data are irregularly spaced, then IDL will automatically grid the data so that the points lie on a regular grid. The gridding is done using the following steps:
- IDL calls the QHULL procedure to construct the Delaunay triangulation. If GRID_UNITS="degrees" then the data is assumed to lie on a sphere, and the SPHERE keyword is passed into QHULL.
- The graphics function then constructs an output grid. The number of points in the X and Y dimensions is automatically determined from the average number of points in the original X and Y data. IDL then evenly distributes these points across the corresponding range of the X and Y coordinates.
- IDL calls the GRIDDATA function, using the Delaunay triangulation and the regular grid. For speed, the Natural Neighbor method is used.
- For non-spherical data, we then compare the interpolated data to the minimum and maximum of the original data. Data points are assumed to be "poorly" interpolated if they lie outside of 10% below the minimum or 10% above the maximum of the original data. If more than 10% of the points are poorly interpolated then IDL throws an error and halts execution. Otherwise, IDL passes the bad data points back into GRIDDATA and uses the Linear method, which is slower but more accurate.
Notes
- You can pass in a named variable to the IRREGULAR keyword to determine if automatic gridding was performed.
- You can retrieve the gridded results using the ::GetData method.
- Depending upon the dataset, the automatic gridding may fail or may produce displeasing results. In this case you should do the gridding yourself, perhaps using a different gridding method to GRIDDATA.
Equation
If the first argument is a string, then it is assumed to represent either an equation of X or the name of an IDL function that accepts an input argument X. Setting this argument is the same as setting the EQUATION property. See EQUATION for details.
Keywords
Keywords are applied only during the initial creation of the graphic.
AXIS_STYLE
Set this keyword to one of the following values:
- 0 - No axes. Decrease the margins so the graphic almost fills the window. This is the default for images.
- 1 - Single X, Y (and Z if 3D) axes located at the minimum data value. The margins will be adjusted to leave space for the axes. This is the default for 3D graphics.
- 2 - Box axes - multiple axes located at both the minimum and maximum data values. The margins will be adjusted to leave space for the axes. This is the default for 2D graphics.
- 3 - Crosshair-style axes - located at the midpoint of each data dimension. Since the axes are in the middle, decrease the margins so the graphic almost fills the window. This is the default for polar plots.
- 4 - No axes, but use the same margins as if axes were there. This is useful if you want to later add another graphic that does have axes, and you want the two visualizations to be aligned properly.
You can set the following properties on the axes:
Property |
Description |
[XYZ]COLOR |
A string or RGB vector containing the axis color.
|
[XYZ]GRIDSTYLE |
A string, integer, or 2-element vector giving the linestyle for tickmarks.
|
[XYZ]LOG |
Set to 1 if the axis is logarithmic. The minimum value of the axis range must be greater than zero.
|
[XYZ]MAJOR |
The number of major tick marks. Set to -1 to auto-compute, set to 0 to suppress.
|
[XYZ]MINOR |
The number of minor tick marks. Set to -1 to auto-compute, set to 0 to suppress.
|
[XYZ]SUBGRIDSTYLE
|
A string, integer, or 2-element vector giving the linestyle for the minor tickmarks. The default is 0, for solid lines. Set to -1 to force minor ticks to have the same linestyle as major ticks.
|
[XYZ]SHOWTEXT |
Set to 1 to show text labels or 0 to hide the text labels.
|
[XYZ]STYLE |
The axis range style. The valid values are:
(0) Nice range. Default for all graphics except Image, Barplot, and Map.
(1) Force the exact data range. Default for Image, Barplot, and Map.
(2) Pad the axes slightly beyond the nice range.
(3) Pad the axes slightly beyond the exact data range.
The [XYZ]RANGE takes precedence over this property.
|
[XYZ]SUBTICKLEN |
The ratio of the minor tick length to the major tick length. The default is 0.5.
|
[XYZ]TEXT_COLOR |
A string or RGB vector containing the axis text color.
|
[XYZ]TEXT_ORIENTATION
|
The angle (in degrees) of the tick mark labels.
|
[XYZ]TEXTPOS |
Set to 1 to position text above the axis. The default is 0, below the axis.
|
[XYZ]THICK |
Set to a floating-point value between 0 and 10 to specify the line thickness for tickmarks. A thickness of 0 gives a thin hairline. The default is 1.
|
[XYZ]TICKDIR |
Set to 1 to draw the tickmarks facing outwards. The default is 0, facing inwards.
|
[XYZ]TICKFONT_NAME
|
A string containing the font name for the axis text.
|
[XYZ]TICKFONT_SIZE
|
The axis text size in points.
|
[XYZ]TICKFONT_STYLE
|
A string or integer containing the font style: normal (0), bold (1), italic (2), or bold italic (3).
|
[XYZ]TICKFORMAT |
A string or string array of tick label formats. See Format Codes for more information.
|
[XYZ]TICKINTERVAL
|
The interval between major tick marks.
|
[XYZ]TICKLAYOUT |
Set to 1 to suppress tick marks; set to 2 to draw a box around the tick labels.
|
[XYZ]TICKLEN |
The length of each major tick mark, normalized to the width or height of the graphic. The default value is automatically calculated based upon the aspect ratio of the graphic.
|
[XYZ]TICKNAME |
A string array containing the tick labels.
|
[XYZ]TICKUNITS |
A string giving the tick units. Valid values are: null (the default, signified by empty quotes), Years, Months, Days, Hours, Minutes, Seconds, Time, exponent for exponential notation, or scientific for scientific notation.
If any of the time units are utilized, then the tick values are interpreted as Julian date/time values. If more than one unit is provided, the axis will be drawn with multiple levels.
|
[XYZ]TICKVALUES |
An array of tick mark locations.
|
[XYZ]TITLE |
A string giving the axis title.
|
[XYZ]TRANSPARENCY
|
An integer from 0-100 giving the percent transparency.
|
For more detailed explanations of these properties, see the AXIS function.
Tip: You can also use the AXIS function to insert additional axes after the graphic has been created.
BUFFER
Set this keyword to 1 to direct the graphics to an off-screen buffer instead of creating a window.
CURRENT
Set this keyword to create the graphic in the current window with a new set of axes. If no window exists, a new window is created. The WINDOW's SetCurrent method may be used to set the current window.
Or, set this keyword to an existing IDL Graphic reference to make that window be the current window and direct the new graphic to that window.
Tip: The CURRENT keyword is usually used with the LAYOUT keyword or POSITION property to produce a window which has multiple graphics in different locations.
Tip: For the graphic share the same axes as an existing graphic, use the OVERPLOT keyword instead.
DEVICE
Set this keyword if values are specified in device coordinates (pixels) for the MARGIN and POSITION keywords. (Normalized coordinates are the default for these keywords.)
DIMENSIONS
Set this keyword to a two-element vector of the form [width, height] to specify the window dimensions in pixels. If you do not specify a value for DIMENSIONS, IDL by default uses the values of the IDL_GR_WIN_HEIGHT and IDL_GR_WIN_WIDTH preferences for Windows platforms or the IDL_GR_X_HEIGHT and IDL_GR_X_WIDTH preferences for X Windows systems on UNIX.
Tip: The minimum width is set by the toolbar in the window, usually around 400 pixels. To create a smaller graphics window, use the NO_TOOLBAR keyword.
LAYOUT
Set this keyword to a three-element vector [ncol, nrow, index] that arranges graphics in a grid. The first dimension ncol is the number of columns in the grid, nrow is the number of rows, and index is the grid position at which to place the graphic (starting at element 1). This keyword is ignored if either OVERPLOT or POSITION is specified.
LOCATION
Set this keyword to a two-element vector [X offset, Y offset] giving the window's screen offset in pixels.
MARGIN
Set this keyword to the current graphic’s margin values in the layout specified by the LAYOUT property. Use a scalar value to set the same margin on all sides, or use a four-element vector [left, bottom, right, top] to specify different margins on each side.
By default, margin values are expressed in normalized units ranging from 0.0 to 0.5. If the DEVICE keyword is set, the values are given in device units (pixels).
This keyword is ignored if either OVERPLOT or POSITION is specified.
NO_TOOLBAR
By default the graphics window will have a toolbar containing some common tools such as Print and Save. Set this keyword to remove the toolbar. This keyword has no effect if the window is already created.
Tip: When the toolbar exists, the minimum window width is set to the toolbar's width, usually around 400 pixels. To create a smaller graphics window, use the NO_TOOLBAR keyword.
NODATA
Set this keyword to 1 to create the graphic, but without any data attached to it. The axes and title (if present) are also created and displayed. If the OVERPLOT keyword is specified, axis ranges will not change.
Note: You must still provide valid input arguments. The data range of the input arguments are used to automatically set the range of the axes. The [XYZ]RANGE properties may be used to override these default ranges.
OVERPLOT
Set this keyword to 1 (one) to place the graphic on top of the currently-selected graphic within the current window. The two graphics items will then share the same set of axes. If no current window exists, then this keyword is ignored and a new window is created.
If you have a graphic in another window that is not currently selected, you can also set this keyword to that graphic's reference to overplot on top of that graphic.
Tip: For the graphic to have a new set of axes, use the CURRENT keyword instead.
WIDGETS
By default, when running from the IDL Workbench, the graphics window will use the native widgets for your platform. Set this keyword to instead use IDL widgets for the graphics window. This keyword is ignored when running from the IDL command line, since IDL widgets are always used in that case.
IRREGULAR
Set this keyword to 1 to force the data to be gridded onto a regular grid. Set this keyword to 0 to disable automatic gridding. By default, if this keyword is not specified, then IDL will automatically grid the data if the X and Y locations are not on a 2D evenly-spaced grid.
TEXTURE_IMAGE
Set this keyword to an array containing an image to be texture mapped onto the surface. If this property is omitted, no texture map is applied and the surface is filled with the color specified by the COLOR or VERTEX_COLORS property. The image array can be a two-dimensional array of color indexes or a three-dimensional array specifying RGB values (3 x n x m, n x 3 x m, or n x m x 3) or RGBA values (4 x n x m, n x 4 x m, or n x m x 4).
Properties
ANTIALIAS
By default anti-aliasing is used when drawing lines for mesh or ruled style. Set this property to 0 to disable anti-aliasing.
ASPECT_RATIO
A floating point value indicating the ratio of the Y dimension to the X dimension in data units. If this property is set to a nonzero value, the aspect ratio will be preserved as the graphic is stretched or shrunk. The default value is 0, meaning that the aspect ratio is not fixed, but is allowed to change as the graphic is stretched or shrunk.
ASPECT_Z
A floating point value indicating the ratio of the Z dimension to the X and Y dimensions, in data units. If this is a nonzero value, the aspect ratio will be preserved as the graphic is stretched or shrunk. The default value is 0, meaning that the aspect ratio is not fixed, but is allowed to change as the graphic is stretched or shrunk.
AXES (Get Only)
This property retrieves an array that contains all of the AXIS objects within the visualization. For example, for a plot visualization:
p = PLOT(/TEST)
ax = p.AXES
ax[0].TITLE = 'X axis'
ax[1].TITLE = 'Y axis'
ax[2].HIDE = 1
ax[3].HIDE = 1
See AXIS for a list of the available properties.
BACKGROUND_COLOR
Set this property to a string or RGB vector indicating the graphic's background color. The default value is [255, 255, 255] (white). Set this property to a scalar value to remove the background color.
Tip: To set the background color of the entire window, retrieve the window object using the WINDOW property, and set the BACKGROUND_COLOR on the window object.
BACKGROUND_TRANSPARENCY
Set this property to an integer between 0 and 100 giving the percent transparency of the background color. The default is 100 (completely transparent).
Note: If the BACKGROUND_COLOR property is changed, and the current background transparency is 100, then the BACKGROUND_TRANSPARENCY will be automatically set to 0 (opaque) so that you can see the new color.
BOTTOM_COLOR
Set this property to a string or RGB vector that specifies the surface bottom color. The default behavior is to make the bottom color match the COLOR property.
CLIP
Set this property to 1 to clip portions of the graphic that lie outside of the dataspace range, or to 0 to disable clipping. The default is 1.
COLOR
Set this property to a string or RGB vector that specifies the surface color.
Note: When you retrieve the COLOR property, the returned value will always be a three-element RGB vector, regardless of how the color was initially specified.
CROSSHAIR (Get Only)
Use this property to retrieve a reference to the Crosshair graphic. All graphics objects within the same set of axes share a single Crosshair graphic. For Plot graphics the default behavior is to display the crosshair when a Mouse_Down event is received. For other graphics the crosshair is disabled. The STYLE property may be used to automatically draw the crosshair, while the LOCATION property may be used to manually draw the crosshair.
You can get and set the following properties on the retrieved crosshair:
Property |
Description |
ANTIALIAS |
Set to 1 to enable anti-aliasing for the lines.
|
COLOR |
A string or RGB vector containing the color.
|
HIDE |
Set to 1 to hide the crosshair, 0 to show.
|
INTERPOLATE |
Set to 1 to force interpolation between Plot data points when SNAP is active. For other graphics this property is ignored. The default is 0.
|
LINESTYLE |
An integer or string giving the line style. The default is 'dot'. See Linestyle Values for additional options.
|
LOCATION |
The location at which to draw the crosshair. For Plot graphics, if SNAP is enabled, then only the X coordinate needs to be supplied. Otherwise, LOCATION should be set to a two-element vector [X, Y] for two-dimensional graphics or [X, Y, Z] for three-dimensional graphics. If STYLE is currently "None", then setting the LOCATION will automatically set the STYLE to "Manual".
|
NAME |
The name of the graphic.
|
SNAP |
Set to 1 to snap the crosshair to the nearest Plot data point. For other graphics this property is ignored. The default is 1.
|
STYLE |
An integer or string giving the crosshair style. Possible values are: 0 - "None" - never draw the crosshair. This is the default for all graphics except 2D plots. 1 - "Manual" - draw the crosshair using the LOCATION property. 2 - "Auto" - automatically draw the crosshair. This is the default for 2D plots.
|
THICK |
The thickness of the lines. The default is 1.
|
TRANSPARENCY |
The percent transparency of the lines. The default is 50.
|
UVALUE |
An IDL variable of any data type.
|
For example, use the CROSSHAIR property to draw a crosshair on an image:
im = IMAGE(/TEST, TRANSPARENCY=50, AXIS_STYLE=2)
c = im.CROSSHAIR
c.COLOR = 'red'
c.THICK = 2
c.LOCATION = [300, 200]
See Creating Functions to Control Mouse Events for a more detailed crosshair example.
DEPTH_CUE
Set this property to a two-element vector [bright, dim] specifying the near and far planes for depth cueing, in normalized units. Depth cueing causes graphics objects that are further away to fade into the background. The first element is where the fade starts to take effect, while the second element is where the objects are completely transparent. Negative values are closer to the eye, while positive values are farther from the eye. The default value is [0, 0] which disables depth cueing. A typical value would be [0, 1], which would cause objects to start to fade at the mid-plane of the window, and completely fade out at a normalized eye distance of 1.
EQN_SAMPLES
Set this property to a scalar or two-element array giving the number of samples to use in the X and Y dimensions with the EQUATION property. If a scalar is specified then the same value is used for both dimensions. A higher value will give a smoother surface but will be slower to compute. The default is 200 points in each dimension. This property has no effect if EQUATION is not set.
EQN_USERDATA
Set this property to an expression containing data of any type. If EQUATION is set to a function and EQN_USERDATA is set, then the value of EQN_USERDATA will be passed in as the third argument to the function. If EQUATION is not set, or if EQUATION is set to an expression of X and Y, then this property will have no effect.
EQUATION
Set this property to a string that contains an equation. The equation can either be a valid IDL statement that has variables named "x" and "y", or the name of a function that accepts two arguments, X and Y. Note that your IDL statement (or function) must be able to handle two-dimensional arrays of X and Y values. In other words, all of the X and Y values are passed in at once, not individually. The result of evaluating the equation with X and Y should be another two-dimensional array containing the surface height data.
- When the surface is displayed, IDL will automatically construct two-dimensional arrays X and Y that span the current axis ranges.
- The initial range is [-10, 10] in both X and Y.
- If EQUATION is an expression, then IDL calls the EXECUTE function once with the X and Y arrays. Note that in certain circumstances (such as the IDL Virtual Machine), you may not be able to use the EXECUTE function.
- If EQUATION is a function name, then CALL_FUNCTION is called once with the X and Y arrays as input arguments. The function should return a two-dimensional result array.
- Once the equation is evaluated, IDL examines the result for any NaN values, and then the X and Y ranges are clipped to only cover valid regions.
- The equation should be a "single" IDL statement (the "&" can not be used). If you need multiple statements, you should construct a function that accepts two arguments, X and Y, and put all of your code within the function.
- If you change the X and Y axis ranges using the XRANGE or YRANGE properties, then a new set of X and Y values is constructed and IDL calls your equation again with the new values.
- You can use EQN_SAMPLES to control the number of sampled points in each dimension.
- You can use EQN_USERDATA to pass in user-defined data to your function.
Example of EQUATION Property with an Expression
The following code will produce a surface with a given equation:
s1 = SURFACE('Real_Part(LambertW(x + !const.I*y))', COLOR='blue', STYLE=0)
s2 = SURFACE('Imaginary(LambertW(x + !const.I*y))', /OVERPLOT, STYLE=0)
Example of EQUATION Property with a Function
To use the EQUATION property with a function, first create the function and save it into a file named ex_surfaceequation.pro somewhere on IDL's current path:
FUNCTION ex_surfaceequation, x, y, userdata
result = LambertW(x + !const.I*y)
RETURN, userdata ? Imaginary(result) : Real_Part(result)
END
Then run the following code to use the equation:
s1 = SURFACE('ex_surfaceequation', COLOR='blue', STYLE=0, EQN_USERDATA=0)
s2 = SURFACE('ex_surfaceequation', /OVERPLOT, STYLE=0, EQN_USERDATA=1)
For a more detailed example see Dynamic Visualizations.
EYE
A floating-point value that specifies the distance from the eyepoint to the viewplane (Z=0). The default is 4.0. The eyepoint is always centered within the viewplane rectangle. IDL converts, maintains, and returns this data as double-precision floating-point.
FONT_COLOR
Set this property to a string or RGB vector that specifies the text color for the title and axes (if present). The default value is "black".
FONT_NAME
Set this property equal to a string specifying the IDL or system font for the title and axes (if present). The default value is "DejaVuSans".
FONT_SIZE
Set this property equal to an integer specifying the font size for the title and axes (if present). The default value is 9 points for the axis text and 11 points for the title.
FONT_STYLE
Set this property equal to an integer or a string specifying the font style for the title and axes (if present). Allowed values are:
Integer |
String |
Resulting Style |
0 |
"Normal" or "rm"
|
Default (roman) |
1 |
"Bold" or "bf" |
Bold |
2 |
"Italic" or "it"
|
Italic |
3 |
"Bold italic" or "bi"
|
Bold italic |
GRID_UNITS
Set this property to an integer or string specifying the units for the surface grid. The GRID_UNITS property applies only when you are inputting data that is irregularly spaced and you want the SURFACE function to automatically grid the data using either a regular grid or a spherical grid. GRID_UNITS has the following possible values:
-
0 or "" - None. The surface coordinates are in arbitrary units that are not tied to a map projection. The units will have no effect on the automatic grid.
-
1 or "m" or "meters" - Meters. The surface coordinates are in meters. Just like GRID_UNITS=0, the units will have no effect on the automatic grid.
-
2 or "deg" or "degrees" - Degrees. The surface coordinates are in degrees longitude/latitude on a sphere. In this case, when gridding irregularly-spaced data, IDL will assume a spherical grid.
Note: The GRID_UNITS property only determines whether the data is treated as lying on a sphere when IDL computes the regularly-gridded data. Once the data has been interpolated to a regular grid, the GRID_UNITS property has no other effect.
HIDDEN_LINES
Set this property to draw point and wireframe surfaces using hidden line (point) removal. By default, hidden line removal is disabled.
HIDE
Set this property to 1 to hide the graphic. Set HIDE to 0 to show the graphic.
LINESTYLE
An integer or string specifying the line style for the surface if the surface style is set to "Mesh", "RuledXZ", "RuledYZ", or "Lego". The allowed values are:
Index |
String (case insensitive) |
0 |
'solid' or '-'(dash)
|
1 |
'dot' or ':'(colon)
|
2 |
'dash' or '--' (double dashes)
|
3 |
'dash dot' or '-.'
|
4 |
'dash dot dot dot' or '-:'
|
5 |
'long dash' or '__' (double underscores)
|
6 |
'none' or ' ' (space)
|
MAX_VALUE
The maximum value to be plotted. If this property is set, data values greater than the value of MAX_VALUE are treated as missing data and are not plotted.
Note: The IEEE floating point value NaN is also treated as missing data.
MIN_VALUE
The minimum value to be plotted. If this property is set, data values less than the value of MIN_VALUE are treated as missing data and are not plotted.
Note: The IEEE floating point value NaN is also treated as missing data.
NAME
A string that specifies the name of the graphic. The name can be used to retrieve the graphic using the brackets array notation. If NAME is not set then a default name is chosen based on the graphic type.
PERSPECTIVE
Set this property to 1 to enable a perspective graphics projection. In the perspective projection, objects that are further away will appear smaller. The default is 0, which is the orthogonal perspective.
POSITION
Set this property to a four-element vector that determines the position of the graphic within the window. The coordinates [X1, Y1, X2, Y2] define the lower left and upper right corners of the graphic. Coordinates are expressed in normalized units ranging from 0.0 to 1.0. On creation, if the DEVICE keyword is set, the units are given in device units (pixels).
Note: After creation, you can set the POSITION to either a two or four-element vector. If two elements are provided, the center of the graphic will be translated to that position. If four elements are provided, the graphics will be translated and scaled to fit the position.
RGB_TABLE
The number of the predefined IDL color table, or a 3 x 256 or 256 x 3 byte array containing color values to use for vertex colors. If the values supplied are not of type byte, they are scaled to the byte range using BYTSCL. Use the VERT_COLORS property to specify indices that select colors from the values specified with RGB_TABLE.
SHADING
Set this property to 1 to use Gouraud shading, or to 0 (the default) to use flat shading. In flat shading the color has a constant intensity for each face of the surface, based on the normal vector.
In Gouraud shading the colors are interpolated between vertices, and then along scanlines from each of the edge intensities.
Gouraud shading may be slower than flat shading, but results in a smoother appearance.
SHOW_SKIRT
Set this property to 1 to draw a skirt around the edges of the surface, at the given SKIRT value. Set to 0 (the default) to disable drawing the skirt.
SKIRT
Set this property to the Z value of the bottom of the skirt. On creation, if SKIRT is set, then SHOW_SKIRT will automatically be set to 1.
STYLE
Set this property equal to an integer or a case-insensitive string specifying the surface style. Allowed values are:
Integer |
String |
0 |
"Points" |
1 |
"Mesh" |
2 |
"Filled" (the default)
|
3 |
"RuledXZ" |
4 |
"RuledYZ" |
5 |
"Lego" |
6 |
"LegoFilled" |
TEXTURE_INTERP
Set this property to a nonzero value to indicate that bilinear sampling is to be used with texture mapping. The default method is nearest-neighbor sampling.
THICK
Set this property to a value between 0 and 10 that specifies the line thickness of the surface lines. A thickness of 0 displays a thin hairline on the chosen device. The default value is 1.
TITLE
Set this property to a string specifying a title. The title properties may be modified using FONT_COLOR, FONT_NAME, FONT_SIZE, and FONT_STYLE. After creation the TITLE property may be used to retrieve a reference to the title text object, and the TEXT properties may be used to modify the title object.
You can add Greek letters and mathematical symbols using a TeX-like syntax, enclosed within a pair of "$" characters. See Adding Mathematical Symbols and Greek Letters to the Text String for details.
TRANSPARENCY
An integer between 0 and 100 that specifies the percent transparency of the surface. The default value is 0.
UVALUE
Set this property to an IDL variable of any data type.
VERT_COLORS
A vector of colors to be used to specify the color of a surface vertex. The vector may be of the form [n*m] or [n, m] where each entry is a color index, or of the form [3,n*m] where each 3-element row is an RGB color, or of the form [4,n*m] where each 4-element row is an RGBA color. To remove vertex colors after they have been set, set VERT_COLORS to a scalar.
If VERT_COLORS is not specified, the entire surface is drawn in the single color provided by the COLOR property, which is the default action. If this keyword is set to a vector or a two-dimensional array of equal size to the data, these values are indices into a color table that can be specified by the RGB_TABLE keyword. If more vertices exist than elements in VERT_COLORS, the elements of VERT_COLORS are cyclically repeated.
WINDOW (Get Only)
This property retrieves a reference to the WINDOW object which contains the graphic.
WINDOW_TITLE
Set this property to the title of the IDL Graphic window. The title is displayed in the window's title bar.
XRANGE
A two-element vector giving the X data range to plot. The default behavior is to plot the entire data range.
YRANGE
A two-element vector giving the Y data range to plot. The default behavior is to plot the entire data range.
ZCLIP
A two element floating-point vector representing the near and far clipping planes to be applied to the objects in this view. The vector should take the form [near, far]. By default, these values are [1, -1]. IDL converts, maintains, and returns this data as double-precision floating-point.
ZRANGE
A two-element vector giving the Z data range to plot. The default behavior is to plot the entire data range.
Version History
8.0 |
Introduced |
8.1 |
Added the following properties: CROSSHAIR, UVALUE, WINDOW, [XYZ]SHOWTEXT, [XYZ]STYLE
Added the following methods: Delete, GetData, GetValueAtLocation, SetData
|
8.2 |
Added AXES, BACKGROUND_COLOR, BACKGROUND_TRANSPARENCY, CLIP properties.
|
8.2.1 |
[XYZ]TICKUNITS accepts exponent as a value.
Added ANTIALIAS property.
|
8.2.2 |
Change POSITION from a keyword to a property.
Added EYE property.
|
8.2.3 |
Added automatic gridding of irregularly-spaced data, the IRREGULAR keyword, and the GRID_UNITS property.
|
8.3 |
Added Equation argument, and EQUATION, EQN_SAMPLES, and EQN_USERDATA properties.
|
8.6 |
Changed default font name and font size. |
See Also
!COLOR, CONTOUR, PLOT, Formatting IDL Graphics Symbols and Lines, Using IDL graphics