help surface
-------------------------------------------------------------------------------

Title

Produce a Wireframe Surface plot

Syntax

surface [var1 var2 var3] [, options]

options Description ------------------------------------------------------------------------- Main saving(filename[, replace ]) saves the graph to a specified file name. round(#) specifies the precision of the x and y variables so that a wireframe can be drawn. labelround(#) specifies the precision of the x, y and z automatic axes labels. orient(string) specifies which axes should be the x, y and z-axes. nowire specifies that the data is plotted as a point and a dropline. xtitle(string) specifies the title for the x-axis. ytitle(string) specifies the title for the y-axis. ztitle(string) specifies the title for the z-axis. xlabel(numlist) specifies the labelling on the x-axis. ylabel(numlist) specifies the labelling on the y-axis. zlabel(numlist) specifies the labelling on the z-axis. -------------------------------------------------------------------------

Description

The function attempts to draw a wireframe plot from three variables. Var1 specifies the x-coordinate, var2 the y-coordinate and var3 the z-coordinate. Alternatively the function can draw a circle at each point and add a straight line going down to the lowest point.

This function can handle data that is not in the form of a matrix of values. However if there are too many x- and y- values the function will attempt to round the dataset values into a more reasonable spread of values. This will result in very messy figures. However in such a case it is the impression that is needed. Many other statistical packages require a full matrix of values. This is not a problem using the nowire option.

At present the state of rotating the diagram is limited to interchanging the axes.

Options

saving(filename [, replace ]) this will save the resulting graph in filename.gph. If the file already exists then use the replace suboption.

nowire this suppresses the drawing of the wire frame in exchange for lines

round(#), data is automatically rounded if there are too many x and y values. This option controls the amount of rounding, for example round(1) rounds the x and y values to the nearest integer.

labelround(#) specifies the precision of the x, y and z automatic axes labels.

orient(string ) this function must take the letters xyz or a combination of them. Whichever letter comes first is the x-axis, second is y-axis and third is the z-axis. Thus orient(zxy) means that var1 is now the y coordinates, var2 is the z-coordinates and var3 is the x-coordinates. This is different from changing the variables around since the wireframe is still draw across the original x and y values. This is a crude attempt to implement rotation to obtain a clearer picture.

xtitle(string) specifies the title for the X-axis, the default is "X-axis"

ytitle(string) specifies the title for the Y-axis, the default is "Y-axis"

ztitle(string) specifies the title for the Z-axis, the default is "Z-axis"

xlabel(numlist) specifies the labelling on the X-axis.

ylabel(numlist) specifies the labelling on the Y-axis.

zlabel(numlist) specifies the labelling on the Z-axis.

Examples

surface x y z, saving(myfile) round(10) orient(zxy)

surface x y z, xtitle(my x title) ytitle(my y title) ztitle(my z title) saving(myfile,replace)

An "immediate" example without using a dataset. Please click the commands in order to avoid problems.

clear <--- NOTE all data is removed you may want to preserve first set obs 900 gen x = int((_n - mod(_n-1,30) -1 ) /30 ) gen y = mod(_n-1,30) gen z = normalden(x,10,3)*normalden(y,15,5) surface x y z surface x y z, zlabel(0 0.005 0.012) labelround(1) xtitle(X-variable)

Author

Adrian Mander, MRC Biostatistics Unit, Cambridge, UK.

Email adrian.mander@mrc-bsu.cam.ac.uk

See Also

Other Graphic Commands I have written:

batplot (if installed) ssc install batplot (to install) cdfplot (if installed) ssc install cdfplot (to install) contour (if installed) ssc install contour (to install) drarea (if installed) ssc install drarea (to install) graphbinary (if installed) ssc install graphbinary (to install) metagraph (if installed) ssc install metagraph (to install) palette_all (if installed) ssc install palette_all (to install) plotbeta (if installed) ssc install plotbeta (to install) plotmatrix (if installed) ssc install plotmatrix (to install) radar (if installed) ssc install radar (to install) trellis (if installed) ssc install trellis (to install)