theme_cut | R Documentation |
theme_cut_top()
and theme_cut_bottom()
are helper functions
that remove ggplot elements at the top and bottom of plots to allow multiple
panels to be stacked together. theme_cut_top()
removes the facet
labels and extra margin at the top of a plot, and theme_cut_bottom()
removes the X-axis title, text, lines, and ticks and the extra margin at the
bottom of a plot.
theme_cut_top()
theme_cut_bottom()
library(ggplot2)
df <- data.frame(x = 1:5, y = 1:5, z = c("a", "b", "c", "b", "c"))
p <- ggplot(df, aes(x, y, color = z)) + geom_point()
p1 <- p + theme_cut_bottom()
p2 <- p + theme_cut_top()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.