Is there anyway of making geom_legend work with geom_bar? I want to have too lines in my legend. It works for geom_line but not for geom_bar charts.
It works fine when I used it here:
ggplot(diamonds, aes(x,y)) +
geom_point(aes(colour = z))+
guides(col = guide_legend(ncol = 2))
The code it doesn't work for is as follows:
ggplot(diamonds, aes(clarity, fill=cut)) +
geom_bar()+
guides(col = guide_legend(ncol = 2))
Thanks for your help.