-
Notifications
You must be signed in to change notification settings - Fork 2k
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
NA drops out of the legend where a named pal is added to scale_colour_manual
#5214
Comments
I thought this is expected behaviour. Since no explicit breaks are specified in either case, scale limits are used to infer default breaks, and ```ggplot2:::manual_scale
If the values vector wasn't named, limits (& hence breaks) will be inferred from the full range of mapped values, in this case |
Indeed, named values imply populating the |
But surely the above plot is not desirable where you end up with grey values in the plot, but nothing in the legend to tell you what those grey values represent? |
Well, no that plot is not too desirable, but so would a plot where you set |
This behavior seems to have changed in ggplot2 3.5.1
I now get NA in my legend for points that are uncolored in my plot. I need these points in my plot. |
@jeraldnoble if you think that is a bug, could you open a new issue with an example/reprex? |
Created on 2023-03-03 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: