Alpha aesthetic shows arrow's skeleton instead of plain shape - how to prevent it?

后端 未结 2 1170

I\'m aiming at building a bar plot with arrows at the end of bars. I went for geom_segment with arrow defined. I want to map one column onto transp

2条回答
  •  萌比男神i
    2021-01-11 15:36

    You could use geom_gene_arrow from library(gggenes)

    data.frame(y=c(10, 20, 30), n=c(300, 100, 200), transparency=c(10, 2, 4)) %>% 
      ggplot() + 
      geom_gene_arrow(aes(xmin = 0, xmax = n, y = y, alpha = transparency), 
                      arrowhead_height = unit(6, "mm"), fill='red') +
      scale_y_continuous(limits = c(5, 35))
    

提交回复
热议问题