-
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
Fill and color guides for factor with drop=FALSE
don't show color.
#5869
Comments
Thanks for the report! This appears to be a duplicate of #5728. The summary of that issue is: we have no intention of changing this behaviour. |
It's a pretty clear regression, something I try to avoid in software I write and maintain. But it's your software and your call. |
I don't think of it as a regression but as trade-off that trades the complex problem of having to tailor |
When existing working code no longer works correctly after a change that is, by definition, a regression. Something we try pretty hard to avoid in maintaining R — not that we always succeed. Thanks for the |
Argueably, the code was working incorrectly before by showing legend keys that weren't present in the data. I get that this might be intended, but this intent has to be explicit now.
As mentioned in #5728, it was displayed in the changelog, described in the release blog and we've since included it in the documentation of the |
We sometimes try to make that argument as well; doesn't usually work very well for us either :-).
That looks good. might be worth having a cross-reference from the The current behavior with just In any case I think we've both spent enough time on this. |
Thanks for this suggestion, I'll reopen to remind us to document this. |
In general, legends are used to show the scale of the measurements and not just the realized values. Additionally, completing the dataframe with respect to the variable being plotted provides the full, correctly formatted legend, without the explicit I support the thinking that this behavior is indeed odd and not very useful. Hope you rethink on such an important issue as it breaks most previous scripts and behavior. |
…hen no data for some levels exists. Fixes tidyverse#5869
In
ggplot2
3.5.1 the fill guide for a factor where not all level sare present butdrop=FALSE
is used shows the label for the missing level but not the color. A simple example:This was different in the version available a year ago. Compare
this from 2024 to this from 2023.
The text was updated successfully, but these errors were encountered: