Skip to main content

A Python implementation of Rainclouds, originally on R, ggplot2. Written on top of seaborn.

Project description

Latest PyPI release Downloads Latest conda-forge release Binder

PtitPrince

A Python implementation of the "Raincloud plot"! See: https://github.com/RainCloudPlots/RainCloudPlots

Installation

You can install it via pip:

pip install ptitprince

or via conda:

conda install -c conda-forge ptitprince

or by cloning this repository and running the following from the root of it:

python setup.py install

Academic use

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 (https://doi.org/10.12688/wellcomeopenres.15191.2)

output

History of this project

This is a Python version of the "Raincloud plot" (or "PetitPrince plot", depending on the orientation) from R (under ggplot2) to Python. The Raincloud plot is a variant of the violin plot written in R ggplot2 by Micah Allen.

I found a tweet asking for a Python version of the Raincloud plot, and I agreed to give it a try. Alas, the Python version for ggplot2 (plotnine) does not allow to create new styles in a comfortable way. So I decided to write this package using the seaborn library as a foundation.

Then I replicated the plots from the original post by Micah Allen, in Jupyter Notebooks and transformed that code into a Python package.

Since then, the package has received some publicity, and is for example listed in "awesome-python-data-science".

Changelog

v.0.2.x

* PtitPrince now relies on seaborn 0.10 and numpy >= 1.13
* kwargs can be passed to the [cloud (default), boxplot, rain/stripplot, pointplot]
                 by preponing [cloud_, box_, rain_, point_] to the argument name.
* End of support for python2, now the support covers python>=3.6

Plans for the future:

  • ask seaborn mantainers to add this new plot type (not gonna happen)
  • add a "move" option in seabon to control the positioning of each plot, as in ggplot2. (either, added in ptitprince)
  • get RainCloud published (done!)
  • add logarithic density estimate (LDE) to the options for the cloud

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ptitprince-0.2.6.tar.gz (12.4 kB view details)

Uploaded Source

Built Distributions

ptitprince-0.2.6-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

ptitprince-0.2.6-py2.py3-none-any.whl (10.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ptitprince-0.2.6.tar.gz.

File metadata

  • Download URL: ptitprince-0.2.6.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ptitprince-0.2.6.tar.gz
Algorithm Hash digest
SHA256 0966e0b585b18d2c1975f526f6fa87ab3c8543ccd76da67c74f542e0d97d19ac
MD5 d743330c880a0874f55dc5c5652d1d3a
BLAKE2b-256 04c9012156c6214d9d99437a2200f8005609e70f053281e8c57a7c6d33f75407

See more details on using hashes here.

File details

Details for the file ptitprince-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: ptitprince-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ptitprince-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 800b3688231a0b5244ed2696228c0f16dff86bf053aede44e424e9dbde484436
MD5 dbe2087a7568034052d84d3ea632c4e4
BLAKE2b-256 dc95c3b9e3883f4ac06566a042db282167f5da14491fccaac538f8805612a62e

See more details on using hashes here.

File details

Details for the file ptitprince-0.2.6-py2.py3-none-any.whl.

File metadata

  • Download URL: ptitprince-0.2.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ptitprince-0.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c257736fac3a4edefd4fe16643daffa3a5eb6092ab2fbbe3e1b7773ced4df577
MD5 d42bd450d47d27ef809265ad42430d32
BLAKE2b-256 03bb0adb7becf94d1378dce0d6332f5fc36017127bba2a9ba39fa36dd893d875

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page