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

todor1/RainCloudPlots

 
 

Repository files navigation

Raincloud Plots

Binder Binder DOI

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

Table of contents

Read the preprint

We originally published Raincloud plots as a preprint at PeerJ. :heart_eyes: THANK YOU :heart_eyes: to everyone who left comments and gave us feedback on that document.

In March we submitted a revised preprint to Wellcome Open Research. Thank you to reviewers Lisa M. DeBruine and Elena Allen for their constructive feedback 🙏✨.

In January 2021, we submitted a revised version to Wellcome Open Research, which now includes a fully functional R-package raincloudplots.

To cite Raincloud plots please use the following information:

Allen M, Poggiali D, Whitaker K et al. Raincloud plots: a multi-platform tool for robust data visualization [version 2; peer review: 2 approved]. Wellcome Open Res 2021, 4:63. DOI: 10.12688/wellcomeopenres.15191.2

Give us 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 preprint. 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! Just check out our contributing guidelines for help getting started.

Citing RainCloud plots

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 and Rogier Kievit.

There is a zenodo archive of the codebase and we ask that you cite the published paper along with the version of the code you used when referring to Raincloud plots.

Allen M, Poggiali D, Whitaker K et al. Raincloud plots: a multi-platform tool for robust data visualization [version 2; peer review: 2 approved]. Wellcome Open Res 2021, 4:63. DOI: 10.12688/wellcomeopenres.15191.2

Allen M, Poggiali D, Whitaker K, Marshall TR, Kievit R. (2018) RainCloudPlots tutorials and codebase (Version v1.1). Zenodo. http://doi.org/10.5281/zenodo.3368186

Get in touch with Kirstie Whitaker if you need help citing a particular version of this codebase.

Interactive tutorials online

You don't have to take our word for it, you can use Project Jupyter's binder to interact with the python and R tutorials yourself.

Just follow either of the links below.

  • Binder will open the python tutorial as an online jupyter notebook.
  • Binder will open an online version of RStudio. You'll need to navigate to the R tutorial (/tutorial_R/raincloud_tutorial_r.Rmd) from within RStudio and open the file to run it.

Raincloud plots in the wild

We are delighted by how popular RainCloud plots have been! In the six months since we published our preprint at PeerJ we have seen the following uses of RainCloud plots "in the wild":

Read more about RainCloud Plots

You can read more about RainCloud plots in the following blog posts:

Installing and running on your local machine

Download from GitHub

The easiest way to get the code you need is to download a copy of this repository to your computer. (You can also clone the repository if you're used to using git and GitHub.)

You'll notice that we've included three copies of the sampled data files, one for each language. This is to hopefully make it as easy for you as possible to run the tutorials and edit the code yourself.

Once you have the repository downloaded and unzipped, jump to the instructions for setting up the enviroment you're most comfortable with: python, R or matlab.

Python environment

The code for RainCloud plots is packaged in the ptitprince python package. It can be installed via pip using: pip install ptitprince.

There are a couple of other dependencies for the raincloud plots tutorial: they're listed in the requirements.txt file in this repository. Note in particular that you must have seaborn version 0.9.0 or above to run the tutorial.

The following instructions will help you install all the necessary dependencies and get up and running really easily ✨.

First, if you don't already have it, we recommend that you install anaconda which will automatically install the jupyter notebook for you.

Then, from inside the RainCloudPlots folder type:

conda create --name rainpy python=3.6

activate rainpy

pip install -r requirements.txt

conda install nb_conda

This will create (and activate) a conda environment with all the the specific packages you need to run the tutorial.

A little note about jupyter notebooks and conda environments. If you have installed nb_conda as described above, you'll be able to choose the rainpy kernel in your jupyter notebook once it's open. Don't forget to switch from the default kernel when you open up the notebook.

From inside the tutorial_python direcotry, open up a jupyter notebook server by typing:

jupyter notebook

Double click on raincloud_tutorial_python.ipynb in your browser, make sure you're using the rainpy kernel, and execute the cells in the notebook.

R environment

There are two ways to make it rain in R: through a series of specific easy to modify scripts, and through our new tailored package, raincloudplots. The former provides a step-by-step walkthrough with individual scripts which can be modified as needed. The latter provides an easy-to-use set of functions for the most common experimental designs and data formats.

raincloudplots - R package

Here's how to install the R-package raincloudplots.

if (!require(remotes)) {
    install.packages("remotes")
}
remotes::install_github('jorvlan/raincloudplots')

library(raincloudplots)

Further package-details and visualization-examples can be found on the GitHub repository that hosts the package.

R tutorial

We recommend that you run the R tutorial through RStudio. You can download the appropriate version of RStudio Desktop for your operating system here.

If you already have RStudio please check that you have knitr version 1.20 or higher.

The following packages will be read in when you run raincloud_tutorial_r.Rmd. They'll be installed if you don't already have them.

packages <- c("cowplot", "readr", "ggplot2" ,
              "dplyr", "lavaan")

From inside the tutorial_R directory, run raincloud_tutorial_r.Rmd.

Matlab environment

You'll need two dependencies to run the matlab tutorial: cbrewer which can be downloaded here and robust_statistical_toolbox which should be downloaded from GitHub in the same way you downloaded this repository.

NOTE: the robust statistical toolbox is made available under the GNU General Public License which is a "copyleft" license. GPL is compatible with MIT (the license for this repository) but supersedes it. Make sure that you are not violating this license when you run the matlab tutorial. 😃

Put both of these dependencies in the tutorial_matlab folder and then, from the parent directory of that directory, run raincloud_tutorial_matlab.mlx.

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • HTML 95.6%
  • Jupyter Notebook 4.0%
  • Other 0.4%