I want to draw a border around an entire ggplot2 plot, such as the box("figure") function would do in case of a Base R plot.
Have a look at the following example:
data <- data.frame(x = 1:5,
y = 1:5)
library("ggplot2")
ggplot(data, aes(x, y)) +
geom_point()
I would like to add a border around this plot as shown below:
I cannot believe that this information doesn't exist anywhere. Unfortunately, all I find is how to add a panel border.
How could I add a border around the ENTIRE ggplot2 plot?