Library: | graphic |
See also: | grsurface |
Quantlet: | grcube | |
Description: | Generates a 3-D cube with labels at the axes and grids on the borders, surrounding a 3-dimensional dataset. |
Usage: | gc = grcube(x{,m,form,textsize}) | |
Input: | ||
x | n x 3 matrix | |
m | 3 x 1 vector or scalar, numbers of labels for each of the axes | |
form | 3 x 1 string vector or 1 string, the formatstring(s) for the axes x, y and z | |
textsize | textsize for labels, default = 14 | |
Output: | ||
gc | composed graphical object: gc.box : box around the data gc.x : label for the x-axes gc.y : label for the y-axes gc.z : label for the z-axes gc.c : label for the corners gc.grxy : grid on xy border gc.grxz : grid on xz border gc.gryz : grid on yz border |
library("graphic") m = matrix(3)* 5 form = "%.2f" | "%.2f" | "%.3f" x = grid(#(-3,-3), #(0.12,0.12), #(31,31)) f = exp(-0.5.*(x[,1]^2+x[,2]^2))./(2.*pi) gc = grcube(x~f,m,form) gs = grsurface(x~f) di = createdisplay(1,1) show(di,1,1,gs,gc.box,gc.x,gc.y,gc.z,gc.c)
shows a surface surrounded by a cube with labels
library("graphic") m = matrix(3)* 5 form = "%.2f" | "%.2f" | "%.3f" x = grid(#(-3,-3), #(0.12,0.12), #(31,31)) f = exp(-0.5.*(x[,1]^2+x[,2]^2))./(2.*pi) gc = grcube(x~f,m,form,16) gs = grsurface(x~f) di = createdisplay(1,1) show(di,1,1,gc.grxy,gc.grxz,gc.gryz,gs,gc.box,gc.x,gc.y,gc.z,gc.c)
shows a surface surrounded by a cube with labels and grids on the borders and text size =16