Repository navigation
refactor show.legend code - #3652
Conversation
|
@thomasp85 Could you take a look at this PR, and maybe also the discussion that prompted it (see link above)? |
yutannihilation
left a comment
There was a problem hiding this comment.
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...
yutannihilation
left a comment
There was a problem hiding this comment.
if it's a good idea to stop ensuring
show.legendis 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