drawEllipse: Draw an ellipse

View source: R/draw.R

drawEllipseR Documentation

Draw an ellipse

Description

Adds an ellipse to an existing plot.

Usage

drawEllipse(x, shape, radius, nv = 100, axes = FALSE,
            fg = par('fg'), bg = NA, colCtr = NA, lty = par('lty'),
            lwd = par('lwd'), pch = par('pch'), cex = par('cex'))

## S3 method for class 'list'
drawEllipse(x, shape, radius, nv = 100, axes = FALSE,
            fg = par('fg'), bg = NA, colCtr = NA, lty = par('lty'),
            lwd = par('lwd'), pch = par('pch'), cex = par('cex'))

## Default S3 method:
drawEllipse(x, shape, radius, nv = 100, axes = FALSE,
            fg = par('fg'), bg = NA, colCtr = NA, lty = par('lty'),
            lwd = par('lwd'), pch = par('pch'), cex = par('cex'))

Arguments

x

either a numerical 2-vector giving the (x,y)-coordinates of the center or a list with the components ctr, cov and magFac as returned by getConfEll or getMinEllipse.

shape

a numerical symmetric (2 x 2)-matrix whose eigen-structure determines the ellipse's shape.

radius

a numerical value giving the ellipse's magnification factor.

nv

number of vertices in the approximating polygon.

axes

logical: should ellipse axes be drawn?

fg

color of the ellipse's rim.

bg

the ellipse's fill color. Set to NA for a fully transparent ellipse.

colCtr

color of the center point. Set to NA to omit.

lty

line type of the ellipse.

lwd

line width of the ellipse.

pch

symbol used for the center of the ellipse.

cex

magnification factor for the symbol used for the center of the ellipse.

Details

This function is mainly a wrapper for polygon.

See Also

polygon, getConfEll, getMinEllipse

Examples

## error ellipse for a set of points
xy <- matrix(round(rnorm(100, 0, 8), 2), ncol=2)
ce <- getConfEll(xy)
plot(xy, pch=16, asp=1)
drawEllipse(ce, radius=1, axes=TRUE, fg='blue', colCtr='blue',
            lwd=2, pch=4, cex=2)

dwoll/shotGroups documentation built on Feb. 16, 2024, 2:21 p.m.