Closed
Description
It seems there is no nice way to create needle plots in ggplot2 whereas it is very easy in classic graphics. geom_linerange
can work but seems too involved and non-obvious. A geom_needle
wrapper around geom_linerange
would be nice.
x <- 1:6
y <- x * c(1, -1)
plot(y ~ x, type = "h")
ggplot(data.frame(x, y), aes(x = x, ymax=pmax(0, y), ymin = pmin(0, y))) +
geom_linerange()