thomasp85 / patchwork

The Composer of ggplots
https://patchwork.data-imaginist.com
Other
2.42k stars 157 forks source link

Rework `add_guides` for arbitrary guide positions #339

Closed teunbrand closed 6 months ago

teunbrand commented 7 months ago

This PR updates patchwork to deal with https://github.com/tidyverse/ggplot2/pull/5488.

Briefly, if https://github.com/tidyverse/ggplot2/pull/5488 gets merged, guides will always have 5 positions in the gtable for left, right, top, bottom and inside positions. This eliminates the need for {patchwork} to work in missing rows/columns of the gtable. Collecting guides from a gtable on the other hand, requires grabbing the guides from 5 guide-boxes instead of 1.

Some visual tests changed at the svg level due to some slight rounding changes, but for humans they look exactly the same. This isn't a consequence of this PR, but of changes in the dev version of ggplot2. Hence, I didn't include those snapshot changes.

teunbrand commented 6 months ago

@thomasp85 This is a kind reminder that it would be swell to merge this in before ggplot2 3.5.0 is released.

thomasp85 commented 6 months ago

Thanks!