Learn R Programming

fields (version 1.2)

surface.Krig: Plots a surface and contours

Description

Creates different plots of the fitted surface of a Krig object. This is a quick way to look at the fitted function over reasonable default ranges.

Usage

surface.Krig(obj, grid.list=NA, extrap=FALSE, graphics.reset=TRUE, 
 xlab = NULL, ylab = NULL, main = NULL, zlab = NULL, zlim = NULL, 
    levels = NULL, type = "b", ...)

Arguments

obj
A Krig object.
grid.list
A list with as many components as variables describing the surface. All components should have a single value except the two that give the grid points for evaluation. If the matrix or data frame has column names, these must appear in the grid list. If
extrap
Extrapolation beyond the range of the data. If false only the convex hull of the observations is plotted. Default is false.
graphics.reset
Reset to original graphics parameters after function plotting.
type
Type of plot as a character. "p" perspective plot (persp). "c" contour plot (contour). "b" a two panel figure with perspective and contour plots. "I" image plot with legend strip (image.plot). "C" image plot with contours overlaid. Both perspective and c
main
Title of plot
xlab
x axis label
ylab
y axis label
zlab
z axis label if "p" or "b" type is used.
zlim
Z limits passed to persp
levels
Contour levels passed to contour.
...
Any other plotting options.

Details

This function is essentially a combination of predict.surface and plot.surface. It may not always give a great rendition but is easy to use for checking the fitted surface. The default of extrap=F is designed to discourage looking at the estimated surface outside the range of the observations.

See Also

Krig predict.surface, plot.surface, image.plot

Examples

Run this code
fit<- Krig(ozone$x,ozone$y, theta=30)  # krig fit 

surface(fit, type="C") #Image plot with  contours

Run the code above in your browser using DataLab