plot.CalSPD: Plot a summed probability distribution

View source: R/plots.R

plot.CalSPDR Documentation

Plot a summed probability distribution

Description

Plot a summed probability distribution (SPD) of radiocarbon dates

Usage

## S3 method for class 'CalSPD'
plot(
  x,
  runm = NA,
  calendar = "BP",
  type = "standard",
  xlim = NA,
  ylim = NA,
  ylab = "Summed Probability",
  spdnormalised = FALSE,
  rescale = FALSE,
  fill.p = "grey75",
  border.p = NA,
  xaxt = "s",
  yaxt = "s",
  add = FALSE,
  cex.axis = 1,
  ...
)

Arguments

x

A CalSPD class object.

runm

A number indicating the window size of the moving average to smooth the SPD. If set to NA no moving average is applied. Default is NA

calendar

Either 'BP' or 'BCAD'. Indicate whether the calibrated date should be displayed in BP or BC/AD. Default is 'BP'.

type

Either 'standard' or 'simple'. The former visualise the SPD as an area graph, while the latter as line chart.

xlim

the x limits of the plot. In BP or in BC/AD depending on the choice of the parameter calender. Notice that if BC/AD is selected BC ages should have a minus sign (e.g. c(-5000,200) for 5000 BC to 200 AD).

ylim

the y limits of the plot.

ylab

(optional) Label for the y axis. If unspecified the default setting will be applied ("Summed Probability")

spdnormalised

A logical variable indicating whether the total probability mass of the SPD is normalised to sum to unity.

rescale

A logical variable indicating whether the SPD should be rescaled to range 0 to 1.

fill.p

Fill colour for the SPD

border.p

Border colour for the SPD

xaxt

Whether the x-axis tick marks should be displayed (xaxt='s', default) or not (xaxt='n').

yaxt

Whether the y-axis tick marks should be displayed (xaxt='s', default) or not (xaxt='n').

add

Whether or not the new graphic should be added to an existing plot.

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex. Default is 1.

...

Additional arguments affecting the plot

See Also

spd; plot.CalGrid

Examples

## Not run: 
data(emedyd)
levant <- emedyd[emedyd$Region=="1"|emedyd$Region=="2",]
bins <- binPrep(levant$SiteName, levant$CRA, h=50)
x <- calibrate(levant$CRA, levant$Error, normalised=FALSE)
spd.levant <- spd(x, bins=bins, timeRange=c(17000,8000))
spd.northernlevant <- spd(x[levant$Region=="2"], bins=bins[levant$Region=="2"],
timeRange=c(17000,8000))
plot(spd.levant, runm=50, xlim=c(16000,9000))
plot(spd.northernlevant, runm=50, add=TRUE, fill.p="black")
legend("topleft", legend=c("All Levant dates","Northern Levant only"), 
fill=c("grey75","black"), border=NA)
plot(spd.levant, runm=50, xlim=c(16000,9000), type="simple")
plot(spd.northernlevant, runm=50, col="red", type="simple", add=TRUE)

## End(Not run)

rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.