
This function makes a default plot of a tree-ring chronology from a
data.frame
of the type produced by chron
.
crn.plot(crn, add.spline = FALSE, nyrs = NULL, f = 0.5,
crn.line.col='grey50',spline.line.col='red',
samp.depth.col='grey90',
samp.depth.border.col='grey80',
crn.lwd=1,spline.lwd=1.5,
abline.pos=1,abline.col='black',
abline.lty=1,abline.lwd=1,
xlab="Time",ylab="RWI",...)# S3 method for crn
plot(x, ...)
a data.frame
e.g., as produced by
chron
. The data.frame
should have the years in
rownames(crn)
, the chronologies in the columns.
Optionally, the last column can contain the sample depth named
"samp.depth"
. If the data are produced via chron
the object will be of class "crn" and the generic plot method can be used
a logical
flag. Will add a line with a
smoothing spline using ffcsaps
a number giving the rigidity of the smoothing spline.
Defaults to 0.33 times the length of the first chronology if
nyrs
is NULL
a number between 0 and 1 giving the frequency response or wavelength cutoff. Defaults to 0.5
color for the x line
color for the spline (if added)
color for the sample depth polygon (if present)
border color for the sample depth polygon (if present)
line width for the x line
line width for the spline (if added)
position for a reference abline on the y-axis. No line added if NULL
color for the reference abline (if added)
line type the reference abline (if added)
line width for the reference abline (if added)
default label for x axis
default label for y axis
Additional arguments to pass to plot
. The
scale of the secondary y axis (sample depth) can be controlled with
argument ylim2
.
None. Invoked for side effect (plot).
This makes a plot of one or more tree-ring chronologies.
# NOT RUN {
library(graphics)
library(utils)
data(cana157)
crn.plot(cana157)
plot(cana157, main='Twisted Tree Heartrot Hill')
# with added spline
crn.plot(cana157,add.spline=TRUE, nyrs=32)
## Without sample depth
cana157.mod <- cana157
cana157.mod$samp.depth <- NULL
crn.plot(cana157.mod, add.spline = TRUE)
## A raw ring-width chronology with prewhitening
data(ca533)
ca533.raw.crn <- chron(ca533, prefix = "CAM", prewhiten=TRUE)
plot(ca533.raw.crn,ylab='mm',
abline.pos=mean(ca533.raw.crn[,1],na.rm = TRUE))
# }
# NOT RUN {
# not pretty - but illustrates the coloring options
my.cols <- c("#3182BD","#9ECAE1","#DEEBF7","#31A354","#A1D99B","#E5F5E0")
crn.plot(cana157,add.spline=TRUE,nyrs=32,
crn.line.col=my.cols[5],
spline.line.col=my.cols[4],
samp.depth.col=my.cols[3],
samp.depth.border.col=my.cols[2],
abline.col=my.cols[1],
crn.lwd=1.5,spline.lwd=3,
abline.lwd=1,
xlab="Year", ylab="RWI")
# }
Run the code above in your browser using DataLab