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?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.