我想使用scale_colour_brewer()
和scale_fill_brewer()
通过brewer调色板指定填充或颜色:
diagram <- diagram + scale_colour_brewer() + scale_fill_brewer()
尽管如此,我还是想手动设置图例标签及其条目。我之前通过以下方式这样做了:
diagram +
scale_colour_manual(name="Cumulative Percentage",
values=c("#d7191c","#fdae61","#000000","#abdda4","#2b83ba"),
labels=c("GN","GN1","GN2","GN3","GN4"))
如何手动设置图例名称和条目标签,如何使用自动调色板功能?
谢谢!
答案 0 :(得分:2)
您也可以在name=
labels=
和scale_colour_brewer().
+ scale_colour_brewer(name="Cumulative Percentage",
labels=c("GN","GN1","GN2","GN3","GN4"))