问题
I'm creating a stacked bar plot of relative abundance data, but I only want to display the ten most abundant organisms in the legend. How do I do this? I have no idea where to begin and haven't found any answers online.
Here's the plot with a full legend:

Thanks.
回答1:
As pointed out by user20650 in the comments, the answer is to add a list of selected items to the breaks=
argument in scale_fill_manual()
scale_fill_manual(breaks=list,values=colpal)
来源:https://stackoverflow.com/questions/30076911/how-do-i-display-only-selected-items-in-a-ggplot2-legend