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

Jitter points not aligned with bar #282

Closed
aherholt opened this issue May 25, 2020 · 2 comments
Closed

Jitter points not aligned with bar #282

aherholt opened this issue May 25, 2020 · 2 comments

Comments

@aherholt
Copy link

Hi,
when I have subgroups in my data and I want to have black data points, the jitter function does not draw the datapoints in alignment with the bar. Any suggestions how to solve this?
best,
Alex

ggbarplot(data, x = "cond", y = "FC", orientation = "vert",
add = c("mean_sd", "jitter"),
color = "black", palette = c("#807F7F", "#BF504D", "#0E71B4"), fill = "supp",
position = position_dodge(0.9),
sort.by.groups = TRUE)

test

@aherholt
Copy link
Author

PS: And thanks for this awesome R package!

@kassambara
Copy link
Owner

kassambara commented May 25, 2020

fixed now, thanks!

Please install the latest dev version.

Reproducible example:

# Change bars fill color by groups
# You need to change also point shapes by groups
library(ggpubr)
ggbarplot(
  ToothGrowth, x = "dose", y = "len", 
  add = c("mean_sd", "jitter"), 
  add.params = list(shape = "supp"),
  fill= "supp", palette = c("#807F7F", "#BF504D"),
  position = position_dodge(0.8)
)

Related blog post: How to Easily Create Barplots with Error Bars in R

Created on 2020-05-25 by the reprex package (v0.3.0.9001)

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

No branches or pull requests

2 participants