axis_geo {palaeoverse} | R Documentation |
axis_geo
behaves similarly to axis
in that it
adds an axis to the specified side of a base R plot. The main difference is
that it also adds a geological timescale between the plot and the axis. The
default scale includes international epochs from the the Geological Timescale
2020 (GTS2020
). However, international stages, periods, eras,
and eons are also available. Interval data hosted by
Macrostrat are also available (see
time_bins
). A custom interval dataset can also be used (see
Details below). The appearance of the axis is highly customisable (see Usage
below), with the intent that plots will be publication-ready.
axis_geo(
side = 1,
intervals = "epoch",
height = 0.05,
fill = NULL,
lab = TRUE,
lab_col = NULL,
lab_size = 1,
rot = 0,
abbr = TRUE,
center_end_labels = TRUE,
skip = c("Quaternary", "Holocene", "Late Pleistocene"),
bord_col = "black",
lty = par("lty"),
lwd = par("lwd"),
bkgd = "grey90",
neg = FALSE,
exact = FALSE,
round = FALSE,
tick_at = NULL,
tick_labels = TRUE,
phylo = FALSE,
root.time = NULL,
...
)
axis_geo_phylo(...)
side |
|
intervals |
The interval information to use to plot the axis: either A)
a |
height |
|
fill |
|
lab |
|
lab_col |
|
lab_size |
|
rot |
|
abbr |
|
center_end_labels |
|
skip |
A |
bord_col |
|
lty |
|
lwd |
|
bkgd |
|
neg |
|
exact |
|
round |
|
tick_at |
A |
tick_labels |
Either a) a |
phylo |
|
root.time |
|
... |
Further arguments that are passed directly to
|
If a custom data.frame
is provided (with intervals
), it should
consist of at least 3 columns of data. See GTS2020
for an
example.
The interval_name
column (name
is also allowed) lists
the names of each time interval. These will be used as labels if no
abbreviations are provided.
The max_ma
column (max_age
is also allowed) lists the
oldest boundary of each time interval. Values should always be
positive.
The min_ma
column (min_age
is also allowed) lists the
youngest boundary of each time interval. Values should always be
positive.
The abbr
column is optional and lists abbreviations that may
be used as labels.
The colour
column (color
is also allowed) is also
optional and lists a colour for the background for each time interval
(see the Color Specification section
here
).
The font
(lab_color
is also allowed) column is
also optional and lists a colour for the label for each time interval
(see the Color Specification section
here
).
intervals
may also be a list if multiple time scales should be added
to a single side of the plot. In this case, height
, fill
,
lab
, lab_col
, lab_size
, rot
, abbr
,
center_end_labels
, skip
, bord_col
, lty
, and
lwd
can also be lists. If these lists are not as long as
intervals
, the elements will be recycled. If individual values
(or vectors, e.g. for skip
) are used for these parameters, they will
be applied to all time scales (and recycled as necessary). If multiple scales
are requested they will be added sequentially outwards starting from the plot
border. The axis will always be placed on the outside of the last scale.
If you would like to use intervals from the Geological Time Scale 2012
(GTS2012
), you can use time_bins
and supply the
returned data.frame
to the intervals
argument.
axis_geo_phylo(...)
is shorthand for
axis_geo(..., phylo = TRUE)
.
No return value. Function is used for its side effect, which is to add an axis of the geological timescale to an already existing plot.
William Gearty & Kilian Eichenseer
Lewis A. Jones
# track user par
oldpar <- par(no.readonly = TRUE)
# single scale on bottom
par(mar = c(6.1, 4.1, 4.1, 2.1)) # modify margin
plot(0:100, axes = FALSE, xlim = c(100, 0), ylim = c(100, 0),
xlab = NA, ylab = "Depth (m)")
box()
axis(2)
axis_geo(side = 1, intervals = "period")
# the line argument here depends on the absolute size of the plot
title(xlab = "Time (Ma)", line = 4)
# stack multiple scales, abbreviate only one set of labels
par(mar = c(7.1, 4.1, 4.1, 2.1)) # further expand bottom margin
plot(0:100, axes = FALSE, xlim = c(100, 0), ylim = c(100, 0),
xlab = NA, ylab = "Depth (m)")
box()
axis(2)
axis_geo(side = 1, intervals = list("epoch", "period"),
abbr = list(TRUE, FALSE))
# the line argument here depends on the absolute size of the plot
title(xlab = "Time (Ma)", line = 6)
# scale with MacroStrat intervals
par(mar = c(6.1, 4.1, 4.1, 2.1)) # modify margin
plot(0:30, axes = FALSE, xlim = c(30, 0), ylim = c(30, 0),
xlab = NA, ylab = "Depth (m)")
box()
axis(2)
axis_geo(side = 1, intervals = "North American land mammal ages")
# the line argument here depends on the absolute size of the plot
title(xlab = "Time (Ma)", line = 4)
# scale with custom intervals
intervals <- data.frame(min_ma = c(0, 10, 25, 32),
max_ma = c(10, 25, 32, 40),
interval_name = c("A", "B", "C", "D"))
par(mar = c(6.1, 4.1, 4.1, 2.1)) # modify margin
plot(0:40, axes = FALSE, xlim = c(40, 0), ylim = c(40, 0),
xlab = NA, ylab = "Depth (m)")
box()
axis(2)
axis_geo(side = 1, intervals = intervals)
# the line argument here depends on the absolute size of the plot
title(xlab = "Time (Ma)", line = 4)
# scale with phylogeny
library(phytools)
data(mammal.tree)
plot(mammal.tree)
axis_geo_phylo()
title(xlab = "Time (Ma)", line = 4)
# scale with fossil phylogeny
library(paleotree)
data(RaiaCopesRule)
plot(ceratopsianTreeRaia)
axis_geo_phylo()
title(xlab = "Time (Ma)", line = 4)
# reset user par
par(oldpar)