Library: | graphic |
See also: | grlinreg2 grsurface grcontour3 contour2 |
Quantlet: | grcontour2 | |
Description: | Generates a contour plot from a three-dimensional data set x |
Usage: | gs = grcontour2 (x, c, {, col}) | |
Input: | ||
x | n x 3 matrix, three-dimensional data. | |
c | m x 1 vector, indicates the levels at which the function is cut. | |
col | optional m x 1 vector, colors of the contour plot. | |
Output: | ||
gs | composed graphical object |
library("graphic") x = grid(#(-3,-2.5), #(0.2,0.2), #(30,30)) f = cos(x[,1])+sin(x[,2])^2 c =(1:9).*max(f)./12 gs = grcontour2(x~f, c) d = createdisplay(1,1) show(d, 1, 1, gs)
Shows a contour plot of a sinus-cosinus function at 9 different cut levels.
library("graphic") library("smoother") x = read("geyser") fh = denestp(x) ; estimate density c =(1:9).*max(fh[,3])./12 gs = grcontour2(fh, c) d = createdisplay(1,1) show(d, 1, 1, gs)
Shows a contour plot of the estimated density of the geyser data set at 9 different levels.