Test

 

hist(random_poisson, ylim = c(0, 30))
abline(v = mean(random_poisson), col = 3, lty = 1, lwd = 4)
abline(v = median(random_poisson), col = 2, lty = 2, lwd = 4)
legend("topright",
legend = c("mean", "median"),
col = c(3,2), lty = c(1,2), lwd = 4,
bty = "n"
)
text(x = mean(random_poisson)-0.3, y = 30, labels = mean(random_poisson))
text(x = median(random_poisson)+0.3, y = 30, labels = median(random_poisson))

alt text test

Figure 1: test