Skip to content
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

geom_violinhalf and geom_violindot not freeing scales with facet_wrap() #81

Open
ascanioalfredoa opened this issue Dec 5, 2020 · 2 comments
Labels
Bug 🐛 Something isn't working

Comments

@ascanioalfredoa
Copy link

Hi!

I installed today "see" from CRAN (v0.6.0) [12/05/2020]

I've been trying to plot a half-violin plot using facet_wrap() while freeing the y scale. It works with the regular violin plot, but not with the geom_violinhalf or geom_violindot. Here is a reproducible example:

library(tidyverse)
library(see)

iris %>%
    pivot_longer(cols = 1:4, names_to = "variable", values_to = "values") %>%
    ggplot(aes(x = Species, y = values, fill = Species)) +
    geom_violin() +
    facet_wrap(~ variable, scales = "free_y") +
    theme_bw()

Which produces this output with the scale free on the y-axis
IssueImage1

While the code using geom_violinhalf or geom_violindot doesn't do that:

iris %>%
    pivot_longer(cols = 1:4, names_to = "variable", values_to = "values") %>%
    ggplot(aes(x = Species, y = values, fill = Species)) +
    geom_violinhalf() +
    facet_wrap(~ variable, scales = "free_y") +
    theme_bw()

IssueImage2

@strengejacke
Copy link
Member

@DominiqueMakowski maybe you have an idea?

@strengejacke strengejacke added the Bug 🐛 Something isn't working label Dec 6, 2020
@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Dec 6, 2020

Not really, though I wonder if we should move to a less hacky way of doing half violins (for instance using ggdist), it would definitly be more robust

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants