Skip to content

Guide custom theme - #5602

Merged
teunbrand merged 2 commits into
tidyverse:rc/3.5.0from
teunbrand:guide_custom_theme
Dec 22, 2023
Merged

teunbrand merged 2 commits into
tidyverse:rc/3.5.0from
teunbrand:guide_custom_theme

Conversation

@teunbrand

Copy link
Copy Markdown
Collaborator

This PR to the RC aims to fix #5601.

Briefly, it applies the same refactoring in #5554 to guide_custom().

Quick demonstration that the theme inheritance is correct: grey fill from guide's theme and blue outline from the plot's theme.

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  guides(custom = guide_custom(
    title = "My circle",
    circleGrob(r = unit(1, "cm")),
    theme = theme(legend.background = element_rect(fill = 'grey90'))
  )) +
  theme(legend.background = element_rect(colour = "blue"))

Created on 2023-12-20 with reprex v2.0.2

@teunbrand teunbrand added this to the ggplot2 3.5.0 milestone Dec 20, 2023

@thomasp85 thomasp85 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand
teunbrand merged commit 49d7a8d into tidyverse:rc/3.5.0 Dec 22, 2023
@teunbrand
teunbrand deleted the guide_custom_theme branch December 22, 2023 09:04
thomasp85 pushed a commit that referenced this pull request Feb 23, 2024
* Apply #5554 to `guide_custom()`

* build in early exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants