scatterplot: Create a scatter plot with error ellipses or crosses

Description Usage Arguments Examples

View source: R/errorellipse.R

Description

Takes bivariate data with (correlated) uncertainties as input and produces a scatter plot with error ellipses or crosses as output. (optionally) displays the linear fit on this diagram, and can show a third variable as a colour scale.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
scatterplot(
  xy,
  alpha = 0.05,
  show.numbers = FALSE,
  show.ellipses = 1,
  levels = NA,
  clabel = "",
  ellipse.fill = c("#00FF0080", "#FF000080"),
  ellipse.stroke = "black",
  fit = "none",
  add = FALSE,
  empty = FALSE,
  ci.col = "gray80",
  line.col = "black",
  lwd = 1,
  hide = NULL,
  omit = NULL,
  omit.fill = NA,
  omit.stroke = "grey",
  addcolourbar = TRUE,
  bg,
  cex,
  xlim = NULL,
  ylim = NULL,
  xlab,
  ylab,
  ...
)

Arguments

xy

matrix with columns X, sX, Y, sY(, rXY)

alpha

the probability cutoff for the error ellipses

show.numbers

logical flag (TRUE to show grain numbers)

show.ellipses

show the data as:

0: points

1: error ellipses

2: error crosses

levels

a vector with additional values to be displayed as different background colours within the error ellipses.

clabel

label for the colour scale

ellipse.fill

Fill colour for the error ellipses. This can either be a single colour or multiple colours to form a colour ramp. Examples:

a single colour: rgb(0,1,0,0.5), '#FF000080', 'white', etc.;

multiple colours: c(rbg(1,0,0,0.5), rgb(0,1,0,0.5)), c('#FF000080','#00FF0080'), c('blue','red'), c('blue','yellow','red'), etc.;

a colour palette: rainbow(n=100), topo.colors(n=100,alpha=0.5), etc.; or

a reversed palette: rev(topo.colors(n=100,alpha=0.5)), etc.

For empty ellipses, set ellipse.col=NA

ellipse.stroke

the stroke colour for the error ellipses. Follows the same formatting guidelines as ellipse.fill

fit

the output of york() (optional).

add

if TRUE, adds the points and lines to the existing plot.

empty

set up an empty plot with the right axis limits to fit the data

ci.col

the fill colour for the confidence interval of the intercept and slope.

line.col

colour of the regression line

lwd

line width of the regression line

hide

vector with indices of aliquots that should be removed from the plot.

omit

vector with indices of aliquots that should be plotted but omitted from the isochron age calculation.

omit.fill

fill colour that should be used for the omitted aliquots.

omit.stroke

stroke colour that should be used for the omitted aliquots.

addcolourbar

add a colour bar to display the colours used to levels

bg

background colour for the plot symbols (only used if show.ellipses=0).

cex

plot symbol magnification.

xlim

(optional) two-element vector with the x-axis limits

ylim

(optional) two-element vector with the y-axis limits

xlab

(optional) x-axis label (only used when add=FALSE)

ylab

(optional) y-axis label (only used when add=FALSE)

...

optional arguments to format the points and text.

Examples

1
2
3
4
5
6
7
8
X <- c(1.550,12.395,20.445,20.435,20.610,24.900,
       28.530,50.540,51.595,86.51,106.40,157.35)
Y <- c(.7268,.7809,.8200,.8116,.8160,.8302,
       .8642,.9534,.9617,1.105,1.230,1.440)
sX <- X*0.02
sY <- Y*0.01
dat <- cbind(X,sX,Y,sY)
scatterplot(dat,fit=york(dat),show.ellipses=2)

Example output



IsoplotR documentation built on July 10, 2021, 1:06 a.m.