Skip to content

Guide custom theme #5602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2023
Merged

Conversation

teunbrand
Copy link
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
Copy link
Member

@thomasp85 thomasp85 left a comment

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