Enhances the '+' operator for ggplot objects to track the history of plot layers and modifications. This function is meant to be used in conjunction with the enhanced ggplot function provided by this package.

# S3 method for class 'gg'
e1 + e2

Arguments

e1

A ggplot object of class 'ggcall'.

e2

A layer, theme or ggcall to add.

Value

A modified ggplot object with updated plot history.

Examples

library(ggplot2, exclude = "ggplot")
p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point()
attr(p, "ggcall") # View the plot call
#> ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()