Use alpha values provided in data

后端 未结 1 1326
星月不相逢
星月不相逢 2020-12-19 09:23

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:03

    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)
提交回复
热议问题