-
Notifications
You must be signed in to change notification settings - Fork 2.1k
refactor show.legend code #3652
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
@thomasp85 Could you take a look at this PR, and maybe also the discussion that prompted it (see link above)? |
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.
Generally looks good. One thing I'm not yet sure is if it's a good idea to stop ensuring show.legend
is a logical vector in layer()
. Let me think a bit...
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.
if it's a good idea to stop ensuring
show.legend
is a logical vector inlayer()
.
Now I come to think this PR does better because show.legend
can be modified after layer()
anyway so it's good to check it right before actually using it.
(A minor downside is that the warning might be shown multiple times but I think it's acceptable.)
That's why I'm overwriting |
Ah, true. Sorry, I don't know why I didn't read the code comment... |
Simplifies and unifies the code that the various guides use to determine which layers to include and exclude. This PR came out of this discussion: https://github.com/tidyverse/ggplot2/pull/3646/files#r353483822