plot.varKernel: Plotting varKernel objects

View source: R/plots.R

plot.varKernelR Documentation

Plotting varKernel objects

Description

Plots a varKernel object as an image or contour plot.

Usage

## S3 method for class 'varKernel'
plot(
  x,
  ...,
  support = getSupport(x),
  SD = supportDiscretization(support, nEval),
  C = x(SD$all, SD$all),
  col = par("col"),
  pch = par("pch"),
  lty = par("lty"),
  lwd = par("lwd"),
  cex = par("lwd"),
  type = c("both", "image", "contour"),
  nEval = 513,
  add = FALSE,
  xlim = getSupport1DPlottingLimits(support),
  ylim = rev(xlim),
  zlim = range(breaks),
  breaks = pretty(c(C), ncol),
  ncol = 10,
  cols = grDevices::hcl.colors(length(breaks) - 1, "YlOrRd", rev = TRUE),
  dWidth = (xlim[2] - xlim[1])/200,
  xlab = "x",
  ylab = xlab,
  zlab = "c",
  notColour = "#FFFFFF"
)

## S3 method for class 'variationKernel'
plot(
  x,
  ...,
  support = getSupport(x),
  SD = supportDiscretization(support, nEval),
  V = x(SD$all),
  col = par("col"),
  pch = par("pch"),
  lty = par("lty"),
  lwd = par("lwd"),
  cex = par("lwd"),
  type = c("both", "image", "contour"),
  nEval = 513,
  add = FALSE,
  xlim = getSupport1DPlottingLimits(support),
  ylim = rev(xlim),
  zlim = range(breaks),
  breaks = pretty(V, ncol),
  ncol = 10,
  cols = grDevices::hcl.colors(length(breaks) - 1, "YlOrRd", rev = TRUE),
  dWidth = (xlim[2] - xlim[1])/200,
  xlab = "x",
  ylab = "x",
  zlab = "c",
  notColour = "#FFFFFF"
)

Arguments

x

an function of two arguments to be plotted. The function is expected to be in an outer vectorized way, i.e. that it returns a matrix, if both arguments are vectors.

...

further arguments for plot

support

the support of the first argument of the function

SD

a support discretization object used to discretized the function

C

the variance kernel evaluated at SD$all

col

a (vector of) plotting colors recycled over functions

pch

a (vector of) plotting chars recycled over functions used for the discrete support

lty

a (vector of) line types recycled over the functions used for the lines of the continuous support

lwd

line width for the countour plot

cex

see par: size of plotting symbols

type

either "both", "image", "contour" defining whether it should be represented by an image or a contour or both.

nEval

the number of discretization points for the continuous support

add

a boolean, if TRUE functions are added to an existing plot, if FALSE a new plot is generated.

xlim

the xlim of a new plot

ylim

the ylim of a new plot, if NULL it will be computed from the range of the functions.

zlim

the limits for plotting the covariance values

breaks

the values for which to change color and where to draw the countour lines.

ncol

the number of colours, it is one less then the number of breaks

cols

the colours to represent the values between the breaks

dWidth

discrete Width, the width to draw the discrete covariance values, which would theoretically take only an infinitely think line.

xlab

the label of the x-axis

ylab

the label of the y-axis y-axis

zlab

the label of the covariance values, not used yet

notColour

the colour to plot outside the range of values

V

the variation kernel evaluated at SD$all

Value

'NULL' invisibly, called for the side effect of producing an image and/or contour plot of the kernel.

Functions

  • plot(variationKernel): method for variationKernel

Examples

C = varKernel(function(x,y) exp(-outer(x,y,"-")^2),basis=B2N01Basis5)
plot(C)
V = variationKernel(function(x) 1-exp(-outer(x,x,"-")^2),basis=B2N01Basis5)
plot(V)

DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.