Closed as not planned
Closed as not planned
Description
openedon Jul 27, 2023
Hello,
I have noticed that ggplot2 reverses the order of categories when the legend is horizontal (e.g., when legend.position = "top", see repex below). This has been raised as a previous issue (#4715), but I find it quite bothersome in practice (as I frequently need to modify the order of categories in the legend using guide_legend()).
Moreover, I believe that the order of categories in the legend should follow a coherent pattern with the order of categories in the graph, just as it does for vertical legends. This would make more sense.
What do you think about this?
I feel that this should not cause too significant a disruption for ggplot2 users.
# repex :
iris%>%
group_by(Species)%>%
count()%>%
ggplot(aes(x = n, y = "y", fill = Species))+
geom_col(position = position_stack())+
theme(legend.position = "top")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels