PsiLAB Help Manual Page

Section: Plot functions (2 independent dimensions)

Name: plot3d_multi

3D plot of data set z(x,y) of 2 independent variables x and y.
This functions can be used to display the matrix z(x,y) on a three dimensional surface plot. The view angles altitude and azimuth can be set independently, the viewing altitude alt in degrees above the xy plane and the viewing azimuth az in degrees. When az=0, the observer is looking face onto the zx plane, and as az is increased, the observer moves clockwise around the box when viewed from above the xy plane. Default values are (20.0,50.0).

?x:(float, 'a, 'b) Matrix.t list
?y:(float, 'c, 'd) Matrix.t list
z:(float, 'e, 'f) Matrix.t

At least the z and the mode arguments are needed. The mode argument sets the display mode:

type plot3d_mode = 
	 Grid 	 | 
	 Shade 	 | 
	 GridShade 	 | 
	 GridBlue 	 | 
	 GridRed 	 | 

Because it's senseless in a surface or grid plot to display matrices with huge sizes, the plot3d functions rescales the z matrix if his sizes nx and ny exceeds a specific value. The nxmax and nymax arguments controll the maximal size of the displayed matrix. Default values are (60,60).
There are several functions for the different display modes:

plot3d Grid and shade (Blue-to-Red color) 3D plot
plot3d1 Grid 3D plot
plot3d2 Shade (Blue-to-Red color) 3D plot
plot3d3 Grid on a green surfcae 3D plot
plot3d4 Grid on a red surface 3D plot
plot3d5 Grind on a blue surface 3D plot

The axis argument controls the drawing of the x,y and z axis, the box and numericals. Valid values: .Nl
type axisstyle = 
	 NoA 	 | (* no axis drawings, no box (3D) *) 
	 Pbox 	 | (* only a box, no ticks, no values *) 
	 XyzTicks 	 | (* 3D only: ticks, but no numerics *) 
	 XyzNumTicks 	 (* 3D only: ticks and numerics *) 


[] let x = fmatrix ~fill:[-6.0;0.05;10.0] () ;; 
[] let y = fmatrix ~fill:[-6.0;0.08;10.0] () ;; 
[] let gaussf = function (x,y) -> 
(0.3+ exp(-0.3*(x*x+y*y)));; 
[] plot3d ~x:[x] ~y:[y] z ();; 

Printed by PsiLAB