-
Notifications
You must be signed in to change notification settings - Fork 2k
plot_layout
Mara Averick edited this page Nov 2, 2018
·
2 revisions
Note: The ggplot2 wiki is no longer maintained, please use the ggplot2 website instead!
Illustration of the various elements of a ggplot. The names are taken from the corresponding opts()
parameters.
(work in progress)
- comprehensive list of all
opts()
- use
gridSVG
and tooltips instead of static annotations.
library(ggplot2)
p <- ggplot(mtcars, aes(mpg, wt, colour = factor(cyl))) + geom_point() + facet_grid(vs ~ am, scales = "free") +
opts(title="Title", panel.margin=unit(2, "line"), plot.margin = unit(rep(3, 4), "lines"))
vp <- viewport(width=0.9, height=0.9)
grid.newpage()
print(p, vp=vp)
grid.rect(vp=vp, gp=gpar(lty=2))