用barplot ggplot2 R中的颜色渐变填充条

时间:2019-01-07 17:35:40

标签: r ggplot2

我想用彩色刻度来填充条形图。 问题是我可以实现ggplot2用所需的音调填充所有小节。  我在做:

p <- ggplot(data=base_c2, aes(x=c2_inicio, y=incid_usuar)) +
  geom_bar(stat="identity", width=0.8, fill=base_c2$incid_usuar) +
 scale_color_gradient2(midpoint=mean(base_c2$incid_usuar), 
                        low ="#91CF60",mid = "#FFFFBF", high = "#FC8D59",
                         space ="Lab")
p

但结果是:enter image description here

如何获得光滑的光泽?  (绿色为低值,黄色为接近平均值,红色为高值)

1 个答案:

答案 0 :(得分:0)

这种方式:

xidel -s config.json -e "$json/(.//apps)()/id" > output.txt

enter image description here

相关问题