Skip to content

geom_violin(draw_quantiles) fails with identical y-values #1641

Closed
@tklebel

Description

@tklebel

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions