Contents Previous Next Subchapters

Creating Surface Plots
Syntax tpsurface(Z)
tpsurface(ZmeshStyle)
tpsurface(ZmeshStylecontourStyle)
tpsurface(ZXY)
tpsurface(ZXYmeshStyle)
tpsurface(ZXYmeshStylecontourStyle)
See Also tpaddzone , tpzone , tpframe , tpopen , tpcontour , tpxyzaxes

Description
Creates surface plots in Tecplot of O-Matrix data. The argument Z must be an integer, real, or double-precision matrix. If present, the argument meshStyle must equal "NONE", "WIREFRAME", "OVERLAY", or "HIDDENLINE". If the value of meshStyle is "NONE", the mesh layer is disabled, otherwise the mesh layer is enabled and the mesh style is set to the given value. If present, the argument contourStyle must equal "NONE", "FLOOD", "LINES", "BOTHLINESANDFLOOD", "AVERAGECELL", or "PRIMARYVALUE". If the value of contourStyle is "NONE", the contour layer is disabled, otherwise the contour layer is enabled and the contour type is set to the given value.

If present, the arguments X and Y must be integer, real or double-precision matrices with row and column dimensions equivalent to Z

If the current Tecplot frame contains a data set that contains variables X, Y, and Z, the tpsurface function creates the surface plot by transferring data to the first zone of the existing data set. If the value of tpzone has been changed to a value other than 1 and that zone exists from the use of tpaddzone or otherwise, the data for the surface plot is transferred to that zone.

Examples

Mesh and Contour Types
If, at the O-Matrix prompt you enter
   clear
   tpopen
   Z = rand(5,4)
   tpsurface(Z)
Tecplot will create a surface plot of the random matrix Z, which looks like,
If you continue by entering
   tpsurface(Z,"HIDDENLINE")
The plot will be re-generated with mesh lines hidden. The mesh and contour styles may be viewed and changed interactively with the Tecplot Zone Style dialog. If you continue by entering
   tpsurface(Z,"NONE","PRIMARYVALUE")
The plot will be re-generated with the Tecplot mesh layer disabled a contouring with the contour value of PRIMARYVALUE and look like

Providing X and Y Values
If X and Y values are not provided, the tpsurface function creates and implicit X, Y grid where the values of X are fillrows(seq(nc)', nr) and the values of Y are fillcols(seq(nr), nc). An alternate grid can be defined by providing X and Y values. If at the O-Matrix prompt you enter,
   tpopen
   nr = 10
   nc = 15
   Z = rand(nr,nc)
   X = fillrows(seq(nc)', nr) + 10
   Y = fillcols(seq(nr), nc) + 20
   tpsurface(Z, X, Y)
Tecplot will create the following surface that uses the alternative X Y grid. The data may also be inspected from the Tecplot "Data | Spreadsheet" dialog.

Using Zones with Surface Plots
It is frequently useful to generate multiple surface plots in a single frame. You can use the tpaddzone and tpzone functions to enable this with tpsurface. If at the O-Matrix prompt you enter,
   clear
   tpopen
   x = -5. : 1. : 5.
   y = x'
   z = x * y / 10.
   tpsurface(z)
Tecplot will create a new surface plot with the value of z. If you continue the example by entering
   zNum = tpaddzone(1,1)
   tpzone(zNum)
   z = (x * y/5) + 5
   tpsurface(z,"none")
Tecplot will create a new zone, with number zNum in the current frame and generate an additional plot and now look like

Using Frames with Surface Plots
A series of surface plots can be created in individual frames. If you enter
   clear
   tpopen
   x = -5. : 1. : 5.
   y = x'
   for i = 1 to 4 begin
      tpframe(["tpsurface(); iteration = ", ntoa(i)])
      z = x*y / (i*2)
      tpsurface(z)
   end
Tecplot will create 4 new frames, where each frame contains the solution from one iteration of the loop. The Cascade Frames option from the Tecplot Quick Macro panel can be used to see the following solution