gghalves icon indicating copy to clipboard operation
gghalves copied to clipboard

The draw_quantiles argument of geom_violin() is deprecated as of ggplot2 4.0.0

Open HaHeho opened this issue 5 months ago • 1 comments

Forwarded from https://github.com/njudd/ggrain/issues/15, as we identified geom_half_violin() to be the cause.

Trying the replacement argument from geom_violin() in geom_half_violin() like gghalves::geom_half_violin(quantiles = 0.5) raises Warning in ggplot(data) + : Ignoring unknown parameters: "quantiles".

However, the previous method gghalves::geom_half_violin(draw_quantiles = 0.5) now raises Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm) : collapsing to unique 'x' values, which I didn't observe previously, likely introduced with the update to ggplot2 4.0.0.

I assume it would be good to similarly deprecate the draw_quantiles and move to quantiles in geom_half_violin() for consistency. However, I'm not sure that resolves the warnings observed in the second case. Is this a solution, or is there another way to avoid the warnings?

I found old discussions with the goal of eliminating this warning, e.g. https://github.com/tidyverse/ggplot2/issues/4455, but I have no understanding of the code to discern why they resurfaced now.

HaHeho avatar Sep 23 '25 18:09 HaHeho

I would be nice to find a fix for this.

HaHeho avatar Oct 23 '25 00:10 HaHeho