Library: | graphic |
See also: | grxline gryline grlinreg grlinreg2 |
Quantlet: | grsurfacecol | |
Description: | generates a surface plot from a 3-dimensional dataset, with different color-levels depending on z-axis. |
Usage: | gs = grsurfacecol(x, colors, nm) | |
Input: | ||
x | n x 3 matrix containing user-defined data determining a grid | |
colors | nm x 1 Color vector | |
nm | Number of color levels | |
Output: | ||
gs | composed graphical object |
library("graphic") x = grid(#(-3,-3), #(0.2,0.2), #(31,31)) f = exp(-0.5.*(x[,1]^2+x[,2]^2))./(2.*pi) freecolor() cl=grcolorscheme("color",10) createcolor(cl) gs = grsurfacecol(x~f,cl,9) d = createdisplay(1,1) show(d, 1, 1, gs)
shows a surface plot with 9 color-levels using colorscheme "color"