Skip to main content

A Python package for creating transparent data graphs including faded dotplots and shadeplots.

Project description

Paircloud ☔️

A hybrid Python/Rust package for creating beautiful, transparent data graphs, particularly faded dotplots, shadeplots, and classic raincloud plots.

Inspired by Dallas Novakowski's blog post and jorvlan/raincloudplots.

Paircloud leverages a fast Rust backend (via pyo3 and ndarray) for computing Kernel Density Estimations (KDE) and an intuitive Python API (via matplotlib) for rendering the visual components.

Installation

You can install Paircloud using uv:

uv pip install -e .

Paircloud Demo Output

Features

  • Faded Dotplots: Stacked data points that systematically fade (alpha mapping) based on their distance from the distribution's mode or median, preventing overplotting.
  • Shadeplots: Density slabs (half-violins) combined with faded dotplots to represent raw data and distributional summaries transparently.
  • Raincloud Plots: The ultimate combination of a half-violin, a boxplot for summary statistics, and jittered individual points for full data transparency.
  • Paired Rainclouds: Visualize clustered, repeated measures data with matched-jitter connective lines safely overlaid between two distinct populations.

Fast Rust Backend

Traditional KDE plots can be slow for large datasets. Paircloud delegates the intensive O(N×M) density evaluations to compiled Rust via paircloud._paircloud_rs.calc_kde.

Example Usage

import numpy as np
import matplotlib.pyplot as plt
import paircloud

# 1. Generate Fake Data
group1 = np.random.normal(loc=5, scale=1.5, size=400)
group2 = np.random.normal(loc=7, scale=1.2, size=300)

fig, axes = plt.subplots(1, 4, figsize=(24, 6))

# 2. Draw Faded Dotplots
ax = axes[0]
paircloud.faded_dotplot(group1, ax=ax, color="#E63946", position=1, orientation="v")
paircloud.faded_dotplot(group2, ax=ax, color="#457B9D", position=2, orientation="v")
ax.set_title("Faded Dotplots")

# 3. Draw Shadeplots
ax = axes[1]
paircloud.shadeplot(group1, ax=ax, color="#E63946", position=1, orientation="v")
paircloud.shadeplot(group2, ax=ax, color="#457B9D", position=2, orientation="v")
ax.set_title("Shadeplots")

# 4. Draw Classic Rainclouds
ax = axes[2]
paircloud.raincloud(group1, ax=ax, color="#E63946", position=1, orientation="v")
paircloud.raincloud(group2, ax=ax, color="#457B9D", position=2, orientation="v")
ax.set_title("Raincloud Plots")

# 5. Paired Raincloud
ax = axes[3]
paired1 = group1[:300]
paired2 = group2[:300]
paircloud.paired_raincloud(paired1, paired2, ax=ax, colors=("#E63946", "#457B9D"), positions=(1, 2), orientation="v")
ax.set_title("Paired Rainclouds")

plt.show()

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paircloud-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (298.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file paircloud-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for paircloud-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e6b10493619b1b27a7138f8bb6d2239f39d67df15175fc45bcbcee8cc884f226
MD5 320f55b1e4980555641e194fdffd4e76
BLAKE2b-256 02590e24aeff19e9727a627c79c0cbb19f95e50840544fe39f2352845ba58478

See more details on using hashes here.

Provenance

The following attestation bundles were made for paircloud-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci.yml on bilacchi/paircloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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