Learn R Programming

gstat (version 0.9-4)

plot.variogram: Plot a Sample Variogram

Description

Creates a variogram plot

Usage

plot.variogram(x, ylim, xlim, xlab = "distance", ylab = "semivariance", 
    multipanel = TRUE, plot.numbers = FALSE, ids = x$id, ...)

Arguments

x
object of class "variogram", obtained from the function variogram, possibly containing directional or cross variograms
ylim
numeric vector of length 2, limits of the y-axis
xlim
numeric vector of length 2, limits of the x-axis
xlab
x-axis label
ylab
y-axis label
model
in case of a single variogram: a variogram model, as obtained from vgm or fit.variogram, to be drawn as a line in the variogram plot; in case of a set of variograms and cross vari
multipanel
logical; if TRUE, directional variograms are plotted in different panels, if FALSE, directional variograms are plotted in the same graph, using color, colored lines and symbols to distinguish them
plot.numbers
logical; if TRUE, plot number of point pairs next to each plotted semivariance symbol
scales
optional argument that will be passed to xyplot in case of the plotting of variograms and cross variograms
ids
ids of the data variables and variable pairs
...
any arguments that will be passed to the panel plotting functions

Value

  • returns (or plots) the variogram plot

synopsis

plot.variogram(x, ylim, xlim, xlab = "distance", ylab = "semivariance", multipanel = TRUE, plot.numbers = FALSE, scales, ids, ...)

References

http://www.gstat.org

See Also

variogram, fit.variogram, vgm variogram.line,

Examples

Run this code
data(meuse)
vgm1 <- variogram(log(zinc)~1, ~x+y, meuse)
plot(vgm1)
model.1 <- fit.variogram(vgm1,vgm(1,"Sph",300,1))
plot(vgm1, model=model.1)
plot(vgm1, plot.numbers = TRUE, pch = "+")
vgm2 <- variogram(log(zinc)~1, ~x+y, meuse, alpha=c(0,45,90,135))
plot(vgm2)
# the following is only to show that directional models also work:
model.2 <- vgm(.59,"Sph",926,.06,anis=c(0,0.3))
plot(vgm2, model=model.2)

Run the code above in your browser using DataLab