Closed ghost closed 7 years ago
although the coloured legend boxes contain a small white
a
Should I file this as a different issue?
That's because you're overriding the fill aesthetic which is used to define the grouping, which affects the ordering. I think if you set group = y2
you should be ok.
First: Hadley, you are truly amazing. To me, you are the personification of data science. I'm a PhD student (antimicrobial resistance analysis, really cool) and I'm always citating your packages that I use in papers (mostly
ggplot2
,dplyr
andreadr
). Thanks for making the life of this microbiologist so much easier!Now the bug: When using
fill
on a label in conjunction with a stacked plot, the order of labels get inverted.Now watch 😉
This code:
Gives the expected result (although the coloured legend boxes contain a small white![image](https://user-images.githubusercontent.com/7526559/28087035-5c8c9132-6681-11e7-9e60-63e783609d8c.png)
a
) :Whereas this code:
Inverts the order, and plots the labels on the other bar:![image](https://user-images.githubusercontent.com/7526559/28087143-b8cb0bfe-6681-11e7-961e-9033a3d05c56.png)
The alignment is also inverted, as you can see.