Closed
Description
Reprex:
mydata <- data.frame(y = rep(1, 10))
ggplot(mydata, aes(x = 1, y)) +
geom_violin(draw_quantiles = .5)
# Error in stats::approxfun(data$y, data$xminv) :
# need at least two non-NA values to interpolate
geom_violin
without draw_quantiles
and geom_boxplot
behave correctly in this situation:
ggplot(mydata, aes(x = 1, y)) +
geom_violin()