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
incorrect labels in the legend for scale_color_manual() #427
It's expected that in the legend you would see 1(red), 2(green), 3(blue).
Instead, labels are assigned to the colors by their order in which they are listed in labels: 4(red) 2(green) 1(blue)
the order of the values and the labels is perfectly matched, but since value 3 is missing in the data, instead of
1(red), 2(green), 4(orange) we have 1(red), 2(green), 3(orange).
Activity
hadley commentedon Apr 12, 2012
Regardless of the other issues, do you think the legend should include all 4 values?
hadley commentedon Apr 12, 2012
In the second example, the only problem is really the labelling of the legend, right? You asked that 4 be mapped to orange, and that's what you got.
hadley commentedon Apr 12, 2012
And the real issue is that the names of labels are not used have no impact - labels are matched purely on position. Did using names ever work?
alyst commentedon Apr 12, 2012
Reimplement named labels vectors for discrete scales.