plot.gmCgram: Draw cuves for covariance/variogram models

View source: R/variograms.R

plot.gmCgramR Documentation

Draw cuves for covariance/variogram models

Description

Represent a gmCgram object as a matrix of lines in several plots

Usage

## S3 method for class 'gmCgram'
plot(
  x,
  xlim.up = NULL,
  xlim.lo = NULL,
  vdir.up = NULL,
  vdir.lo = NULL,
  xlength = 200,
  varnames = colnames(x$nugget),
  add = FALSE,
  commonAxis = TRUE,
  cov = TRUE,
  closeplot = TRUE,
  ...
)

Arguments

x

object to draw, of class gmCgram // curently only valid for symmetric functions

xlim.up

range of lag values to use in plots of the upper triangle

xlim.lo

range of lag values to use in plots of the lower triangle

vdir.up

geograohic directions to represent in the upper triangle

vdir.lo

geograohic directions to represent in the lower triangle

xlength

number of discretization points to use for the curves (defaults to 200)

varnames

string vector, variable names to use in the labelling of axes

add

logical, should a new plot be created or stuff be added to an existing one?

commonAxis

logical, is a common Y axis for all plots in a row desired?

cov

logical, should the covariance function (=TRUE) or the variogram (=FALSE) be plotted?

closeplot

logical, should the plot be left open (FALSE) for further changes, or be frozen (TRUE)? defaults to TRUE

...

further graphical parameters for the plotting function

Value

This function is called for its side effect of producing a plot: the plot will be open to further changes if you provide closeplot=FALSE. Additionally, the function invisibly returns the graphical parameters that were active before starting the plot. Hence, if you want to freeze a plot and not add anymore to it, you can do par(plot(x, closeplot=FALSE, ...)), or plot(x, closeplot=TRUE, ...). If you want to further add stuff to it, better just call plot(x, closeplot=FALSE,...). The difference is only relevant when working with the screen graphical device.

See Also

Other gmCgram functions: [.gmCgram(), [[.gmCgram(), as.function.gmCgram(), as.gmCgram.variogramModelList(), length.gmCgram(), ndirections(), variogramModelPlot()

Examples

utils::data("variogramModels")
v1 = setCgram(type=vg.Gau, sill=diag(3)-0.5, anisRanges = 2*diag(c(3,0.5)))
v2 = setCgram(type=vg.Exp, sill=0.3*diag(3), anisRanges = 0.5*diag(2))
vm = v1+v2
plot(vm)
plot(vm, cov=FALSE)

gmGeostats documentation built on April 18, 2023, 5:08 p.m.