-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Violin quantiles are based on observations #5912
base: main
Are you sure you want to change the base?
Conversation
I'm considering whether Would it make sense to have the stat always compute the quantile, and the geom drawing it depending on the value of |
In principle I agree with you, though there are some practicalities that may get in the way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not like how the stat flows into the how the geom behaves. Is it not possible to gracefully deprecate the old behaviour.
So, geom_violin()
will check the value of draw_quantile
. If it is not a boolean it will emit a deprecation warning and forward the value to quantiles
in the stat (which does what draw_quantile
does now)
We should discuss if we should give this the #5423 treatment. So instead of |
This PR aims to fix #4120.
Briefly, instead of GeomViolin estimating quantiles based on the density, StatYdensity includes
quantile
as a computed variable. GeomViolin is then able to draw the quantiles based on that computed variable.I consider this a breaking change as StatYdensity how 'owns' the
draw_quantiles
parameter, rather than GeomViolin. For users, this should only matter when they are breaking the link betweengeom_violin()
andstat_ydensity()
. It is also a visual change, as the quantiles are now correct.Reprex from the issue, notice how the red quantiles of the violin now aligns with the boxplot quantiles.
Created on 2024-05-28 with reprex v2.1.0