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

Option for simplifying the ggplot code #24

Open
KirstieJane opened this issue Dec 12, 2018 · 0 comments
Open

Option for simplifying the ggplot code #24

KirstieJane opened this issue Dec 12, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@KirstieJane
Copy link
Member

Copied from feedback at PeerJ: https://peerj.com/preprints/27137/#feedback-1203

This is fantastic - thanks for writing it! One idea for simplifying the ggplot2 code: instead of dealing with two different data frames (one summary, one containing the raw data), you could use stat_summary() to create the summary for you. For instance, plot 7 could be generated with:

ggplot(simdat, aes(x=group, y=score, fill = group, colour = group)) +
geom_flat_violin(position = position_nudge(x = .25, y = 0), adjust =2) +
geom_point(position = position_jitter(width = .15), size = .25) +
stat_summary(geom="errorbar", fun.data="mean_cl_boot", position = position_nudge(.25), colour = "BLACK", size = 0.8, width = .1) +
stat_summary(geom="point", fun.data="mean_cl_boot", position = position_nudge(.25), colour = "BLACK") +
ylab('Score') + xlab('Group') + coord_flip() + theme_cowplot() + guides(fill = FALSE, colour = FALSE) +
scale_colour_brewer(palette = "Dark2") +
scale_fill_brewer(palette = "Dark2") +
ggtitle("Figure 7: Raincloud Plot with Mean ± 95% CI")
@KirstieJane KirstieJane added the enhancement New feature or request label Dec 12, 2018
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

1 participant