stamp_grid: Stamp a grid for decoupling annotation from plotting

View source: R/stamp_grid.R

stamp_gridR Documentation

Stamp a grid for decoupling annotation from plotting

Description

Stamp a grid for decoupling annotation from plotting

Usage

stamp_grid(color = "turquoise4", fill = "linen", alpha = 0.5)

Arguments

color

grid color, defaults to 'turquoise4'

fill

overlay color, defaults to 'linen'

alpha

numeric between 0 and 1, level of transparency for grid layer

Examples

library(ggplot2)
ggplot(cars) +
  aes(x = speed) +
  aes(y = dist) +
  geom_point() +
  facet_wrap(~speed > 15) ->
 p

cowplot::ggdraw(p) +
  stamp_grid() + # you can comment this guide out later
  stamp_text_ljust(label = "Over on this side we look at the slow cars." %>%
  stringr::str_wrap(15), x = .15, y = .8, size = 5) +
  stamp_segment(x = .35, xend = .35, y = .2, yend = .7,
                size = .5, linetype = "dashed") +
  stamp_text_ljust(label = "Over here, fast cars!" %>%
  stringr::str_wrap(15), x = .6, y = .2, size = 5) +
  stamp_curve(x = .65, y = .27, xend = .79, yend = .5, curvature = -.2)


EvaMaeRey/ggstamp documentation built on June 30, 2022, 11 p.m.