Entering edit mode
2.7 years ago
Ne
▴
10
my code look like this;
ggplot(data=my_data, aes(x=samples, y=relative_abundance, fill=species.Name)) + geom_bar(position = "fill",stat = "identity") + scale_fill_manual(name=NULL, values = cols) + labs(x = NULL, y = "Relative Abundance")+ theme_classic()+ theme(legend.text = element_text(face = "italic"), legend.key.size = unit(10, "pt"), legend.background = element_rect(fill="lightgray"))+ guides(color=guide_legend(ncol =1))
and I want to collect legend into one column, I tried to add this line in my code but it did not work.
guides(color=guide_legend(ncol =1))
Thanks a lot, it works )