theme_cut: Remove elements at the top or bottom of a ggplot

theme_cutR Documentation

Remove elements at the top or bottom of a ggplot

Description

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.

Usage

theme_cut_top()

theme_cut_bottom()

Examples

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()


christyray/crthemes documentation built on April 14, 2023, 11:18 p.m.