Learn R Programming

khroma (version 1.1.1)

scale_colour_stratigraphy: Geologic Timescale Colour Scheme for ggplot2

Description

Provides the geologic timescale colour scheme.

Usage

scale_colour_stratigraphy(..., aesthetics = "colour")

scale_color_stratigraphy(..., aesthetics = "colour")

scale_fill_stratigraphy(..., aesthetics = "fill")

Arguments

...

Arguments passed on to discrete_scale.

aesthetics

A character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with.

Details

Values will be matched based on the unit names.

References

Commission for the Geological Map of the World

See Also

Other Themed colour schemes: scale_colour_soil

Examples

Run this code
# NOT RUN {
library(ggplot2)

strati <- data.frame(
  name = c("Phanerozoic", "Paleozoic", "Cambrian", "Ordovician", "Silurian",
           "Devonian", "Carboniferous", "Mesozoic", "Triassic", "Cretaceous",
           "Jurassic", "Cenozoic", "Paleogene", "Neogene", "Quaternary"),
  type = c("Eon", "Era", "Period", "Period", "Period", "Period", "Period",
           "Era", "Period", "Period", "Period", "Era", "Period", "Period",
           "Period"),
  start = c(541, 541, 541, 485, 444, 419, 359,
            252, 252, 201, 145, 66, 66, 23, 2.6),
  end = c(0, 252, 485, 444, 419, 359, 252,
          66, 201, 145, 66, 2.6, 23, 2.6, 0)
)

ggplot(strati, aes(fill = name)) +
  geom_rect(aes(xmin = rep(0, 15), xmax = rep(1, 15),
                ymin = start, ymax = end)) +
  scale_y_reverse() +
  facet_grid(.~type) +
  khroma::scale_fill_stratigraphy(name = "Stratigraphy")
# }

Run the code above in your browser using DataLab