Skip to content

patchwork doesn't play nice with certain theme arguments #148

Closed
@akarlinsky

Description

@akarlinsky

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions