PLPLOT includes routines that will represent a single-valued function of two variables as a surface. In this section, we shall assume that the function to be plotted is <#945#>Z[X][Y]<#945#>, where <#946#>Z<#946#> represents the dependent variable and <#947#>X<#947#> and <#948#>Y<#948#> represent the independent variables.
As usual, we would like to refer to a three dimensional point <#949#>(X,Y,Z)<#949#>
in terms of some meaningful user-specified coordinate system. These are
called <#950#>three-dimensional world coordinates<#950#>. We need to specify the
ranges of these coordinates, so that the entire surface is contained within the
cuboid defined by
This two-stage transformation process allows considerable flexibility in
specifying how the surface is depicted. The lengths of the sides of the
normalized box are independent of the world coordinate ranges of each of the
variables, making it possible to use ``reasonable'' viewing angles even if the
ranges of the world coordinates on the axes are very different. The size of the
normalized box is determined essentially by the size of the two-dimensional
window into which it is to be mapped. The normalized box is centred about the
origin in the x and y directions, but rests on the plane
The first step in drawing a surface plot is to decide on the size of the two-dimensional window and the normalized box. For example, we could choose the normalized box to have sides of length
A reasonable range for the x coordinate of the two-dimensional window is -2.5 to +2.5, since the length of the diagonal across the base of the normalized box isverbatim13#
The routine <#1080#>plwind<#1080#> (page #plwind#1081>
For example, if the three-dimensional world-coordinate ranges are
verbatim14#
The values of the function are stored in a two-dimensional array <#979#>z[][ly]<#979#> where the array element <#980#>z[i][j]<#980#> contains the value of the function at the point xi, yj. Note that the values of the independent variables xi and yj do not need to be equally spaced, but they must lie on a rectangular grid. Thus two further arrays <#981#>x[nx]<#981#> and <#982#>y[ny]<#982#> are required as arguments to <#983#>plot3d<#983#> to specify the values of the independent variables. The values in the arrays x and y must be strictly increasing with the index. The argument <#984#>opt<#984#> specifies how the surface is outlined. If <#985#>opt=1<#985#>, a line is drawn representing z as a function of x for each value of y, if <#986#>opt=2<#986#>, a line is drawn representing z as a function of y for each value of x, and if <#987#>opt=3<#987#>, a net of lines is drawn. The first two options may be preferable if one of the independent variables is to be regarded as a parameter, whilst the third is better for getting an overall picture of the surface. The final parameter <#988#>work<#988#> is an integer array with at least four times <#989#>max(nx,ny)<#989#> points, which is required for workspace.
Labelling a three-dimensional plot is somewhat more complicated than a two
dimensional plot due to the need for skewing the characters in the label
so that they are parallel to the coordinate axes. The routine <#1088#>plbox3<#1088#> (page #plbox3#1089>
The routine <#1090#>plside3<#1090#> (page #plside3#1091>