Routines (alphabetical) > Object Classes > Graphics Object Classes > IDLgrSurface::Init

# IDLgrSurface::Init

Syntax | Return Value | Arguments | Keywords | Version History

The IDLgrSurface::Init function method initializes the surface object.

Note: Init methods are special lifecycle methods, and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: if you write your own subclass of this class, you can call the Init method from within the Init method of the subclass.

## Syntax

Obj = OBJ_NEW('IDLgrSurface' [, Z [, X, Y]] [, PROPERTY=value])

or

Result = Obj->[IDLgrSurface::]Init([Z [, X, Y]] [, PROPERTY=value]) (In a lifecycle method only.)

## Return Value

When this method is called indirectly, as part of the call to the OBJ_NEW function, the return value is an object reference to the newly-created object.

When called directly within a subclass Init method, the return value is 1 if initialization was successful, or zero otherwise.

## Arguments

### X

A vector or two-dimensional array specifying the X coordinates of the grid. If this argument is a vector, each element of X specifies the X coordinates for a column of Z (e.g., X[0] specifies the X coordinate for Z[0, *]). If X is a two-dimensional array, each element of X specifies the X coordinate of the corresponding point in Z (Xij specifies the X coordinate of Zij). This argument is stored as double precision floating point values if the argument variable is of type DOUBLE or if the DOUBLE property is non-zero, otherwise it is stored as single precision floating point.

Note: The value specified by the X argument is used to initialize the value of the DATAX property of the IDLgrSurface object.

### Y

A vector or two-dimensional array specifying the Y coordinates of the grid. If this argument is a vector, each element of Y specifies the Y coordinates for a column of Z (e.g., Y[0] specifies the Y coordinate for Z[*, 0]). If Y is a two-dimensional array, each element of Y specifies the Y coordinate of the corresponding point in Z (Yij specifies the Y coordinate of Zij). This argument is stored as double precision floating point values if the argument variable is of type DOUBLE or if the DOUBLE property is non-zero, otherwise it is stored as single precision floating point.

Note: The value specified by the Y argument is used to initialize the value of the DATAY property of the IDLgrSurface object.

### Z

The two-dimensional array to be displayed. If X and Y are provided, the surface is defined as a function of the (X, Y) locations specified by their contents. Otherwise, the surface is generated as a function of the array indices of each element of Z. This argument is stored as double precision floating point values if the argument variable is of type DOUBLE or if the DOUBLE property is non-zero, otherwise it is stored as single precision floating point.

Note: The value specified by the Z argument is used to initialize the value of the DATAZ property of the IDLgrSurface object.

## Keywords

Any property listed under IDLgrSurface Properties that contains the word “Yes” in the “Init” column of the properties table can be initialized during object creation using this method. To initialize the value of a property, specify the property name as a keyword set equal to the appropriate property value.

All other keywords are passed to the superclass of this object.

## Version History

5.0 | Introduced