Skip to content

Code and tutorials to visualise your data that is both beautiful *and* statistically valid

License

Notifications You must be signed in to change notification settings

KTZ228/RainCloudPlots

 
 

Repository files navigation

Raincloud Plots

Paper license r-package r-package python-package

Code and tutorials to visualise your data in a way that is both beautiful and statistically valid.

Table of contents

Making Rainclouds in R

Option 1

ggrain - R package

Check out theggrain Github and the vignette for more details + tutorials!

Install

install.packages('ggrain')

Plot

library(ggrain)

ggplot(iris, aes(Species, Sepal.Length, fill = Species)) + 
	geom_rain()

Option 2

raincloudplots - R package

Install

remotes::install_github('jorvlan/raincloudplots')

Plot

library(raincloudplots)

df_1x1 <- data_1x1(
  array_1 = iris$Sepal.Length[1:50],
  array_2 = iris$Sepal.Length[51:100],
  jit_distance = .09,
  jit_seed = 321)
  
raincloud_1_h <- raincloud_1x1(
  data = df_1x1, 
  colors = (c('dodgerblue','darkorange')), 
  fills = (c('dodgerblue','darkorange')), 
  size = 1, 
  alpha = .6, 
  ort = 'h') +

scale_x_continuous(breaks=c(1,2), labels=c("Group1", "Group2"), limits=c(0, 3)) +
  xlab("Groups") + 
  ylab("Score") +
  theme_classic()

raincloud_1_h

Making Rainclouds in Python

PtitPrince - Python package

Check out the Github and the tutorial for more details!

Install

pip install ptitprince

Plot

import ptitprince as pt

pt.RainCloud(x = dx, y = dy, data = df, palette = pal, bw = sigma,
                 width_viol = .6, ax = ax, orient = ort)

Attribution

We really hope you find these tutorials helpful and want to use the code in your next paper or presentation!

This repository is made available under the MIT license which means you're welcome to use and remix the contents so long as you credit the creators: Micah Allen, Davide Poggiali, Kirstie Whitaker, Tom Rhys Marshall, Jordy van Langen, Nicholas Judd and Rogier Kievit.

If you use rainclouds please cite us!

Paper

- Allen, M., Poggiali, D., Whitaker, K., Marshall, T. R., van Langen, J., & Kievit, R. A.
    Raincloud plots: a multi-platform tool for robust data visualization [version 2; peer review: 2 approved] 
    Wellcome Open Research 2021, 4:63. https://doi.org/10.12688/wellcomeopenres.15191.2

Feedback

We'd love to hear your thoughts and any feedback you have. The best place to leave comments on the paper and the project in general is at the Wellcome Open Research paper. Just scroll to the bottom of that page (or click on the link at the side) and leave us feedback or ask a question.

You can also open an issue or submit a pull request to this repository if you find a bug! If it is a package specific question please make an issue on the ggrain or PtitPrince repositories.

Just check out our contributing guidelines for help getting started.

Happy plotting!

About

Code and tutorials to visualise your data that is both beautiful *and* statistically valid

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 95.5%
  • Jupyter Notebook 4.0%
  • Other 0.5%