Closed
Description
If I change the spacing of the legend inside a theme, patchwork failes:
pacman::p_load(tidyverse, patchwork)
p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear, color=am))
theme_set(theme_classic())
p1 + p2
ggplottheme <- theme_classic() +
theme(
legend.box.spacing = margin(t=-5,b=-5),
)
theme_set(ggplottheme)
p1 + p2
#> Error in grid.Call.graphics(C_setviewport, vp, TRUE): invalid 'layout.pos.col'
Created on 2020-01-23 by the reprex package (v0.3.0)
Metadata
Metadata
Assignees
Labels
No labels