Learn R Programming

fields (version 1.2)

plot.surface: Plots a surface

Description

Plots a surface object in several different ways to give 3-d information e.g. a contour plots, perspective plots.

Usage

plot.surface
(obj, main = NULL, type = "b", zlab = NULL, xlab = NULL,
    ylab = NULL, levels = NULL, zlim = NULL, graphics.reset = NULL,
   ...)

Arguments

obj
A surface object. At the minimum a list with components x,y and z in the same form as the input list for the standard contour and persp functions. This can also be an object from predict.surface.
main
Title for plot.
type
type="p" for a perspective plot, type="c" for a contour plot and type="b" for both (default). type="I" for an image plot with a legend strip (see image.plot). type="C" is the "I" option with contours lines added.
zlab
z-axes label
xlab
x-axes label
ylab
y-axes labels
levels
Vector of levels to be passed to contour function.
graphics.reset
Reset to original graphics parameters after function plotting. Default is to reset if type ="b" but not for the single plot options.
zlim
Sets z limits on perspective plot.
...
Other graphical parameters that are passed along to either persp, contour or image.

See Also

surface, predict.surface, as.surface,

Examples

Run this code
fit<- Tps( BD[,1:4], BD$lnya) # fit surface to data 

# make grid list 
grid<-list( KCl="x", MgCl2=mean(BD[,2]),KPO4="y", dNTP=mean(BD[,4]))

# evalute on a grid on two 
# variables holding two fixed at their mean levels 
out.p<-predict.surface(fit, grid, extrap=TRUE)  

plot.surface(out.p, type="C") # surface plot

Run the code above in your browser using DataLab