A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/thomasp85/patchwork/issues/222 below:

Option to put tags inside of plot borders? · Issue #222 · thomasp85/patchwork · GitHub

Some journals, like Oecologia, require panel tags to be inside of plot boundaries. Using theme(plot.tag = element_text(hjust = , vjust = ) is fiddly and doesn't put tags in consistent distance from plot borders.

library(ggplot2)
library(patchwork)

p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear))
p3 <- ggplot(mtcars) + geom_smooth(aes(disp, qsec))


(p1 | p2 | p3) +plot_annotation(tag_levels = "a", tag_prefix = "|", tag_suffix = "|") &
  theme(plot.tag.position = c(0,1),
        plot.tag = element_text(hjust = -2.5, vjust = 1))
#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Created on 2020-12-03 by the reprex package (v0.3.0)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4