R 平滑ggplot2中堆叠条中线段之间的颜色

R 平滑ggplot2中堆叠条中线段之间的颜色,r,ggplot2,R,Ggplot2,假设我有一个堆叠的酒吧,每个部分都有不同的颜色 require(dplyr) require(ggplot2) dm <- diamonds %>% group_by(cut, color) %>% summarize(ave.price=mean(price)) ggplot(dm) + geom_bar(aes(x=cut, y=color, fill=ave.price), stat="identity") + scale_fill_continuous(low="w

假设我有一个堆叠的酒吧,每个部分都有不同的颜色

require(dplyr)
require(ggplot2)
dm <- diamonds %>% group_by(cut, color) %>% summarize(ave.price=mean(price))
ggplot(dm) + geom_bar(aes(x=cut, y=color, fill=ave.price), stat="identity") +
  scale_fill_continuous(low="white", high="red")
是否有一种方法可以平滑分段之间的颜色过渡