Skip to content

guides = "collect" does not work when using different themes #466

@z3tt

Description

@z3tt

Hi Thomas,

I just noticed that applying two different themes breaks the guide merging logic.

library(ggplot2)
library(patchwork)

p1 <- ggplot(mpg, aes(hwy, displ, color = drv)) +
    geom_point()

p2 <- ggplot(mpg, aes(cty, displ, color = drv)) +
    geom_point() + 
    theme_minimal()

(p1 + p2) + plot_layout(guides = "collect") &
    theme(legend.position = "bottom")

Created on 2026-03-16 with reprex v2.1.1

Guess that's a decision (or maybe also technical difficulty?) as it'd need to decide which theme to apply to the legend.

Not sure it ever worked before but it would be kinda neat to have an option to combine differently themed plots. Do you think that's possible?

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