gridData generates a grid data set of class 'gridData',
persp generates a perspective plot from a grid data set,
contour generates a contour plot from a grid data set.}gridData(x = (-10:10)/10, y = x, z = outer(x, y, function(x, y) (x^2+y^2) ) )## S3 method for class 'gridData':
persp(x, theta = -40, phi = 30, col = "steelblue",
ticktype = "detailed", \dots)
## S3 method for class 'gridData':
contour(x, addImage = TRUE, \dots)
x and y are two numeric vectors of grid pounts
and z is a numeric matrix or any other rectangular object
which can be transformed by the function as.matrix into
a persp.gridData -
A list with at least three entries, x, y and z.
The returned values, can be directly used by the persp.gridData()
and contour.gridData 3D plotting methods.## gridData -
# Grid Data Set
gD = gridData()
persp(gD)
contour(gD)Run the code above in your browser using DataLab