R 我的比例的低颜色\u填充\u渐变()保持白色

R 我的比例的低颜色\u填充\u渐变()保持白色,r,ggplot2,R,Ggplot2,关于条形图的基本问题。我正在处理以下条形图: ggplot(bnc_1994_dataset, aes(x=reorder(DM, -Freq), y=Freq, fill=Freq))+ geom_bar(stat="identity")+ theme_minimal()+ scale_fill_gradient2(low="cadetblue", high="royalblue")+ labs(title="

关于条形图的基本问题。我正在处理以下条形图:

ggplot(bnc_1994_dataset, aes(x=reorder(DM, -Freq), y=Freq, fill=Freq))+
  geom_bar(stat="identity")+
  theme_minimal()+
  scale_fill_gradient2(low="cadetblue", high="royalblue")+
  labs(title="DM raw frequency bar graph", x="DM combination", y="raw frequency")+
  theme(axis.text.x=element_text(angle=70))
我得到以下输出:

我不明白为什么低值没有按照
scale\u fill\u gradient2()
命令中的规定显示在cadetblue中

最好的


Cameron

将函数从scale\u fill\u gradient2()更改为scale\u fill\u gradient2()解决了我的问题,不知道为什么

这是对你的问题和答案的回答

scale\u fill\u gradient()
接受两个参数:
low
high
scale\u fill\u gradient2()
需要第三个:
mid