Mar*_*ras 20 plot r colors scale ggplot2
我在ggplot2对象上应用两个不同的更改时遇到问题.我有一个有3组的条形图.我想要:
我找到了以下解决上述问题的方法:
+ scale_fill_manual(values = c("red", "green", "blue"))+ scale_fill_discrete(guide = guide_legend(reverse=TRUE))问题是第二个application(+ scale_fill_discrete(...))覆盖了第一个:
Scale for 'fill' is already present. Adding another scale for 'fill', which will replace the existing scale.
Run Code Online (Sandbox Code Playgroud)
(分别两者都很好).怎么处理呢?
BBr*_*ill 29
你不需要把它加倍,这应该工作:
scale_fill_manual(values = c("red", "green", "blue"),name= "My name", guide = guide_legend(reverse = TRUE))
Run Code Online (Sandbox Code Playgroud)