Skip to main content

Python tests Python 3.9+ Latest PyPI release Downloads Latest conda-forge release Downloads on conda 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 directly from GitHub

pip install git+https://github.com/pog87/PtitPrince

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

See CHANGELOG.md for detailed version history.

v.0.3.1

* Modern packaging with pyproject.toml
* Comprehensive test suite with 89% coverage
* Python 3.9-3.12 support
* Removed default palette to avoid seaborn 0.14 warnings
* Pre-commit hooks and code quality improvements

v.0.3.0

* Seaborn 0.13.2 compatibility
* Fixed raincloud component alignment with hue
* Improved dodge alignment and axis labels

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 logarithmic density estimate (LDE) to the options for the cloud
  • add the repeated measure feature

Metadata

Release files for ptitprince 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ptitprince 0.3.1
File Size Uploaded
ptitprince-0.3.1.tar.gz 4.2 MB Details

Release files / ptitprince-0.3.1.tar.gz

Download URL ptitprince-0.3.1.tar.gz
Size 4.2 MB
Tags Source
SHA-256 checksum
How to use checksums
2840a3a1d8daba6567c15ce192d683da75a5d2b648451a1a26b271485b70254d
BLAKE2b-256 checksum
How to use checksums
3bd57ce2fd2f19d1559a04dc8a91af137320d6f32f78b9aa65e3d0d5eaa46fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.2.7

1 release file

0.2.6

3 release files

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page