Draws thesurface of a two-dimensional array with hidden lines removed.
x (optional) A vector or two-dimensional array specifying the x-coordinates for the surface.
If the T3D keyword is set, the 3D to 2D ;transformation matrix contained in !P.T must project the Z axis to a line parallel to the device Y axis, or errors will occur.
.RUN
FUNCTION f, x, y
RETURN, x * SIN(y) + y * COS(x)
END
Define the function.
x = FINDGEN(101)/5-10
Create vector of
x
-coordinates.
y = x
Create vector of
y
-coordinates.
z = FLTARR(101, 101)
Create an array to hold the function values.
FOR i = 0, 100 DO FOR j = 0, 100 DO z(i, j) = f(x(i), y(j))
Evaluate the function at the given
x
- and
y
-coordinates and
; place the result in z.
SURFACE, z, x, y, Ax = 50, XCharsize = 2, $ YCharsize = 2, ZCharsize = 2
Display the surface. The
Ax
keyword is used to specify the
; angle of rotation about the
x
-axis. The
XCharsize
,
YCharsize
,
; and
ZCharsize
keywords are used to enlarge the characters
; used to annotate the axes.
XYOUTS, 163, 477, $ "f(x, y) = x*sin(y) + y*cos(x)", Charsize = 2, /Device
Place a title on the window. Note that the CURSOR procedure
; with the
Device
keyword was used to locate the proper position
; for the title.
Figure 2-121 Surface with title.
Figure 2-122 Surface with title.
For more information, see Chapter 5, Displaying 3D Data, in the PV-WAVE Programmer's Guide.