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
geom_segment
arrow
You could use geom_gene_arrow from library(gggenes)
geom_gene_arrow
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))