You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Legends should not use after_scale()ed values #3729
Currently, legends reflect the value of after_scale(). But, it's not always possible because the expression of after_scale() might refer to the variable unavailable at the stage of drawing legends.
For example, I think it is a proper usage of stage() to modify scaled colours by combining other aesthetics. But, the following example has two problems:
x is not available on drawing legends
even if we manage to make x available, it's not clear what legends should be drawn because the scaled colours are discrete but the after_scale()ed values are continuous.
Especially because of the problem 2., I think legends should use the raw scaled values, not the after_scale()ed ones.
Another example. While this doesn't fail, the legends for colour lose their colours. I think they should be coloured.
I bet this is just a corner case and not a blocking issue, so I don't include this in the v3.3.0 milestones. But, I hope we can reach to some conclusion about whether my claim is valid or not before this feature is released.
there are valid reasons for having the legend reflect the transformation as well
Ah, agreed. While I'm raising this issue, I also feel the example in your post is the case when it's visually more sound when the legends reflect the transformation. I have no idea what interface the switch should be, but probably it's needed here.
For reference, while we closed this, this case is not fixed. We decided this is not worth fixing compared to the complexity. Let's revisit here when it's necessary.
Activity
yutannihilation commentedon Jan 14, 2020
Another example. While this doesn't fail, the legends for
colourlose their colours. I think they should be coloured.I bet this is just a corner case and not a blocking issue, so I don't include this in the v3.3.0 milestones. But, I hope we can reach to some conclusion about whether my claim is valid or not before this feature is released.
Created on 2020-01-14 by the reprex package (v0.3.0)
thomasp85 commentedon Jan 15, 2020
yeah - I think you are right... I didn't think these implications through when I added the legend modification code...
on the other hand, there are valid reasons for having the legend reflect the transformation as well... Maybe we should add a switch?
yutannihilation commentedon Jan 15, 2020
Ah, agreed. While I'm raising this issue, I also feel the example in your post is the case when it's visually more sound when the legends reflect the transformation. I have no idea what interface the switch should be, but probably it's needed here.
Created on 2020-01-15 by the reprex package (v0.3.0)
yutannihilation commentedon Feb 6, 2020
For reference, while we closed this, this case is not fixed. We decided this is not worth fixing compared to the complexity. Let's revisit here when it's necessary.
Created on 2020-01-14 by the reprex package (v0.3.0)