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

Feature request, plot full box with dots #9

Open
wavefancy opened this issue Jul 20, 2020 · 1 comment
Open

Feature request, plot full box with dots #9

wavefancy opened this issue Jul 20, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@wavefancy
Copy link

Hi Developers.

Is there any chance to support box with dots as full box plot, instead of just half box. An example of style as below, a plot from poltly.

boxplot with dots side by side

Thank you very much for this great work.

Best regards
Wallace

@erocoar erocoar self-assigned this Nov 8, 2020
@erocoar erocoar added the enhancement New feature or request label Nov 8, 2020
@erocoar
Copy link
Owner

erocoar commented Mar 6, 2021

Hi, sorry for my late reply. I hope this is still useful somehow :)
It might be easiest for you to use the gghalves package and plot a half boxplot (with center = TRUE and a half point plot.

E.g.:

library(gghalves)
df <- data.frame(score = rgamma(150, 4, 1), 
                 gender = sample(c("M", "F"), 150, replace = TRUE), 
                 genotype = factor(sample(1:3, 150, replace = TRUE)))

ggplot(df) + 
  geom_half_boxplot(aes(x = genotype, y = score, fill = gender), center = TRUE, side = "r") +
  geom_half_point(aes(x = genotype, y = score, fill = gender), side = "l", shape = 21) +
  scale_fill_manual(values = c("#ecb21e", "#812e91")) 

image

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

No branches or pull requests

2 participants