This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gggeo_scale <- function(gg, fill = NULL, color = "black", alpha = 1, height = .05, size = 5, quat = FALSE, pos = "bottom", abbrv = TRUE, periods = NULL, neg = FALSE) { | |
#This is a function to add a geologic time scale to a ggplot object. | |
#gg: the ggplot object | |
#fill: the fill color of the boxes; default are the colors from the Commission for the Geological Map of the World (CGMW); | |
# custom fill colors can be provided and will be recycled if necessary | |
# if a custom dataset is provided with periods without color and without fill, a greyscale will be used | |
#color: the outline color of the boxes | |
#alpha: transparency of the fill colors | |
#height: the proportional height of the plot to use for the scale | |
#size: the size of the text in the scale |