# contour-methods: Methods for Contour Plots in Package 'copula' In copula: Multivariate Dependence with Copulas

 contour-methods R Documentation

## Methods for Contour Plots in Package 'copula'

### Description

Methods for function `contour` to draw contour lines aka a level plot for objects from package copula.

### Usage

```## S4 method for signature 'Copula'
contour(x, FUN,
n.grid = 26, delta = 0,
xlab = quote(u), ylab = quote(u),
box01 = TRUE, ...)
## S4 method for signature 'mvdc'
contour(x, FUN, xlim, ylim, n.grid = 26,
xlab = quote(x), ylab = quote(x),
box01 = FALSE, ...)
```

### Arguments

 `x` a `"Copula"` or a `"mvdc"` object. `FUN` the `function` to be plotted; typically `dCopula` or `pCopula`. `n.grid` the number of grid points used in each dimension. This can be a vector of length two, giving the number of grid points used in x- and y-direction, respectively; the function `FUN` will be evaluated on the corresponding (x,y)-grid. `delta` a small number in [0, 1/2) influencing the evaluation boundaries. The x- and y- vectors will have the range `[0+delta, 1-delta]`, the default being `[0,1]`. `xlab, ylab` the x-axis and y-axis labels. `xlim, ylim` the `range` of the x and y variables, respectively. `box01` a logical specifying if a faint rectangle should be drawn on the boundary of [0,1]^2 (often useful for copulas, but typically not for general multivariate distributions (`"mvdc"`)). `...` further arguments for (the default method of) `contour()`, e.g., `nlevels`, `levels`, etc.

### Methods

Contour lines are drawn for `"Copula"` or `"mvdc"` objects, see `x` in the Arguments section.

The `persp-methods` for “perspective” aka “3D” plots.

### Examples

```contour(frankCopula(-0.8), dCopula)
contour(frankCopula(-0.8), dCopula, delta=1e-6)
contour(frankCopula(-1.2), pCopula)
contour(claytonCopula(2), pCopula)

## the Gumbel copula density is "extreme"
## --> use fine grid (and enough levels):
r <- contour(gumbelCopula(3), dCopula, n=200, nlevels=100)
range(r\$z)# [0, 125.912]
## Now superimpose contours of three resolutions:
contour(r, levels = seq(1, max(r\$z), by=2), lwd=1.5)
contour(r, levels = (1:13)/2, add=TRUE, col=adjustcolor(1,3/4), lty=2)