cbrviz
Small, composable Matplotlib building blocks for statistical figures — strip/box plots with p-value annotation, KDE ridges and split violins, XY panels with correlation and zoom, dot plots / correlation plots, and Kaplan-Meier curves.
Every class is a thin wrapper around a validated DataFrame plus a handful of
ax-based draw methods, so you keep full control of the figure.
Install
pip install cbrviz
Two statistics back-ends are optional:
pip install "cbrviz[survival]" # KME (scikit-survival)
pip install "cbrviz[stats]" # StripBox.calc_pairwise_p (scikit-posthocs)
pip install "cbrviz[all]" # both
Quickstart
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from cbrviz import StripBox
rng = np.random.default_rng(0)
df = pd.DataFrame({
"expression": np.concatenate([rng.normal(m, 1, 30) for m in (5.0, 6.5, 5.2)]),
"genotype": np.repeat(["WT", "KO", "Rescue"], 30),
})
sb = StripBox(df, s1_order=["WT", "KO", "Rescue"])
fig, ax = plt.subplots()
sb.boxplt(ax=ax, showfliers=False)
sb.add_strips(ax=ax, s=12)
sb.add_global_p(ax=ax)
sb.calc_pairwise_p(posthoc_method="dunn") # needs cbrviz[stats]
sb.add_pair_p("WT", "KO", ax=ax)
usage() — a runnable example for every class
Not sure how a class works? Ask it:
>>> from cbrviz import Ridge
>>> Ridge.usage()
# Typical use of Ridge
import numpy as np
...
Modules
| import | what it draws |
|---|---|
StripBox, SplitStripBox, PairedStripBox |
box + strip plots, global & pairwise p-values |
KDE, KDE2D, Ridge, SplitViolin |
1-D / 2-D kernel density, ridgeline, split violin |
XYview, XYpairs, XYzoom |
scatter with correlation / regression / labelled points / zoom inset |
Dotplot, Corrplot |
grid dot plots and clustered correlation plots |
KME |
Kaplan-Meier curves, log-rank, pairwise log-rank heatmap (needs cbrviz[survival]) |
resolve_categories, resolve_colors |
helpers for level ordering and palette resolution |
Heatmap (cbrviz.heatmap) is a placeholder and raises NotImplementedError.
Development
git clone https://github.com/fossbert/cbrviz
cd cbrviz
pip install -e ".[test]"
pytest
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cbrviz-0.1.0.tar.gz.
File metadata
- Download URL: cbrviz-0.1.0.tar.gz
- Upload date:
- Size: 39.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
793ba945d952837c385aee5f5066d376f577e5893b4ed26e8b98f98a54f2e04d
|
|
| MD5 |
d5bda2699c2a486c7f2fd7c8b47efaee
|
|
| BLAKE2b-256 |
77596dfb8b9c1b135970bf09618535001d8c07bd20ce332c6748bcb09841434b
|
Provenance
The following attestation bundles were made for cbrviz-0.1.0.tar.gz:
Publisher:
release.yml on fossbert/cbrviz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbrviz-0.1.0.tar.gz -
Subject digest:
793ba945d952837c385aee5f5066d376f577e5893b4ed26e8b98f98a54f2e04d - Sigstore transparency entry: 2643811749
- Sigstore integration time:
-
Permalink:
fossbert/cbrviz@85262be8071074643215589c18940fc339f2f36a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fossbert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@85262be8071074643215589c18940fc339f2f36a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cbrviz-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cbrviz-0.1.0-py3-none-any.whl
- Upload date:
- Size: 42.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dac9b975524e4282a5b8d39b8b2d15eae41180641cbd08de951a16ee19736de
|
|
| MD5 |
4f0d5d90f442902fc0453cdffbe73b2b
|
|
| BLAKE2b-256 |
111824b745de22eea45ed3a0a9c3686e57346303fe8024e48b973d3d652ae29c
|
Provenance
The following attestation bundles were made for cbrviz-0.1.0-py3-none-any.whl:
Publisher:
release.yml on fossbert/cbrviz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbrviz-0.1.0-py3-none-any.whl -
Subject digest:
2dac9b975524e4282a5b8d39b8b2d15eae41180641cbd08de951a16ee19736de - Sigstore transparency entry: 2643811809
- Sigstore integration time:
-
Permalink:
fossbert/cbrviz@85262be8071074643215589c18940fc339f2f36a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/fossbert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@85262be8071074643215589c18940fc339f2f36a -
Trigger Event:
push
-
Statement type: