Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6600.

Briefly, we initiate x = 0 or y = 0 when they are missing, similar to stat_boxplot().
Examples based on the issue for both orientations:

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2
df <- data.frame(x = rnorm(100))

ggplot(df, aes(x = x)) +
  geom_violin()

ggplot(df, aes(y = x)) +
  geom_violin()

Created on 2025-09-24 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent behaviour of geom_boxplot() and geom_violin()
1 participant