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

How to add a jitter to ggdotplot? #178

Closed
Adam-JJJJJ opened this issue May 17, 2019 · 2 comments
Closed

How to add a jitter to ggdotplot? #178

Adam-JJJJJ opened this issue May 17, 2019 · 2 comments

Comments

@Adam-JJJJJ
Copy link

When i used the geom_dotplot function in ggplot2, i can made the dot be jitter by position = "jitter". However, in ggdotplot, when i tried to use the parameter of add.params=list(position="jitter”), dot just separated from the error bar. May i ask that what's wrong with my codes?
image
The picture below is what I want. THANKS.
image

ggplot(a1, aes(x = Treatment, y = Value)) +geom_dotplot(binaxis = "y", stackdir = "centerwhole",stackratio=0.5,position = "jitter")

ggdotplot(a1, x = "Treatment", y = "Value", fill = "Treatment", palette = c("#0AFAC8", "#CD0000", "#5A9AD5"), binwidth = 0.3,add.params = list(position = "jitter"),add = c("mean_se"))+ stat_compare_means(comparisons = my_comparisons1, paired = FALSE,method = "t.test", method.args = list(var.equal=TRUE),label = "p.signif")+ ylab("Relative expression level")+xlab("")

@kassambara
Copy link
Owner

The argument position is now handled by ggdotplot(). Please install the latest developmental version and try this:

library(ggpubr)
ggdotplot(ToothGrowth, x = "dose", y = "len", add = "mean_sd", 
          fill = "dose", position = position_jitter(0.1))

Rplot

@Adam-JJJJJ
Copy link
Author

The argument position is now handled by ggdotplot(). Please install the latest developmental version and try this:

library(ggpubr)
ggdotplot(ToothGrowth, x = "dose", y = "len", add = "mean_sd", 
          fill = "dose", position = position_jitter(0.1))

Rplot

Thank ur codes very much. But i still have another question ,please.
#104 (comment)

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