Use alpha values provided in data

后端 未结 1 1128
一整个雨季
一整个雨季 2020-12-19 09:19

I would like to use the explicit values for the alpha level.

head(D)

    x  y group  alpha
  1 1 18     A   0.40   <~~~~
  2 2 18     A   0.44
  3 3 18            


        
相关标签:
1条回答
  • 2020-12-19 10:10

    If you have actual alpha, color, ..., values then you should use ..identity() scales. This will tell ggplot() to assign alpha values as they are in your data frame and not to scale them.

    ggplot(data=D, aes(x=x, y=y, alpha=alpha)) + 
             geom_bar(stat="identity", fill="blue") + 
             facet_grid(group ~. ) +
             scale_alpha_identity()
    
    0 讨论(0)
提交回复
热议问题