-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Change behaviour of theme_update to be more like an update #1519
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
Conversation
…g theme_replace that has the same behaviour as the old theme_update. Also expanded and clarified the documentation for these.
@wch do you remember the motivation for using |
#' @export | ||
|
||
theme_replace <- function(...) { | ||
# Make a call to theme, then add to theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove this comment? (and in the previous fun)
Looks good. Just a few minor tweaks and can you please add a bullet point to NEWS? |
Done! |
@@ -1,5 +1,9 @@ | |||
# ggplot2 2.0.0.9000 | |||
|
|||
* `theme_update()` now uses the `+` operator instead of `%+replace%`, so that | |||
unspecified values will no longer be `NULL`ed out. `theme_replace()` | |||
preserves the old behaviour if desired (#1519). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please cite your github user name in the brackets?
Done! |
Thanks! |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Per discussion in #1489, this changes
theme_update()
to use the+
operator, so that unspecified attributes of the element being set are taken from the current theme, rather thanNULL
ing them out. I've addedtheme_replace()
with the same behaviour as the currenttheme_update()
, in case that behaviour is desired (though I'm hard-pressed to think of a use case).I've also added some verbiage to the documentation clarifying what these do, along with examples.