You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
guides = "collect" does not work when using different themes #466
Patchwork merges guides that are identical on the grid level. It doesn't know about the ggplot2-level properties of guides (for example it doesn't know if they share breaks or glyphs or anything of the sort).
To merge legends affected by different themes, you need to force them to use the same theme (or otherwise ensure they're styled identically).
In the example below, we're forcing the first plot's legend to adapt to the same theme as the second plot.
Nice example for the guide_legend() functionality! While preparing a "real-life" use case I also realized that one can use the same theme and then modify one plot as well.
Closing this issue, but adding this example for the sake of completeness:
Activity
teunbrand commentedon Mar 16, 2026
Hi Cédric,
Patchwork merges guides that are identical on the grid level. It doesn't know about the ggplot2-level properties of guides (for example it doesn't know if they share breaks or glyphs or anything of the sort).
To merge legends affected by different themes, you need to force them to use the same theme (or otherwise ensure they're styled identically).
In the example below, we're forcing the first plot's legend to adapt to the same theme as the second plot.
Created on 2026-03-16 with reprex v2.1.1
z3tt commentedon Mar 16, 2026
Nice example for the
guide_legend()functionality! While preparing a "real-life" use case I also realized that one can use the same theme and then modify one plot as well.Closing this issue, but adding this example for the sake of completeness:
Created on 2026-03-16 with reprex v2.1.1