Registry / data / corner

corner

JSON →
library2.2.3pypypi✓ verified 86d ago

Corner.py makes beautiful corner plots (scatter plot matrices) for visualizing high-dimensional datasets, commonly used in Bayesian analysis (e.g., MCMC chains). Current version 2.2.3 requires Python >=3.9. Releases are infrequent, mainly maintenance.

pip install corner
INSTALL
IMPORT
SIG · CORNER
C
corner
datapythonv2.2.3
Install
7.3s avg
Import
2692ms
Disk
181MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.736s · 177.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.3s · import 2.648s · 170MB
181MB installed
● package 181MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

corner
import corner
from corner import corner
corner.corner() is the main function; importing corner.corner directly is not recommended.

Create a simple corner plot from random samples.

import corner import numpy as np # Generate random samples ndim = 5 nsamples = 10000 np.random.seed(42) samples = np.random.randn(ndim * nsamples).reshape([nsamples, ndim]) # Make the corner plot figure = corner.corner(samples) # Save to file figure.savefig("corner_plot.pdf")
Debug
Known issues
gotchaThe `corner.corner()` function returns a matplotlib `Figure` object, not a `GridSpec` or an array of axes. Do not try to unpack the return value.
fix
Capture the figure: `fig = corner.corner(...)` and use `fig.axes` to access subplots.
affects: >=2.0.0
deprecatedThe `smooth` parameter for KDE smoothing is deprecated in favor of `smooth1d` and `smooth2d`.
fix
Use `smooth1d=...` and/or `smooth2d=...` instead of `smooth=...`.
affects: >=2.2.0
gotchaWhen passing `truths` (true parameter values), the list length must match the dimensionality of the samples (number of columns).
fix
Ensure `truths` has the same number of elements as the columns of `samples`.
affects: all
gotchaThe `labels` parameter overrides the `quantiles` display on the histograms. If you want quantiles shown, ensure `labels` is not set or set it to include them.
fix
Either omit `labels` or pass a list of label strings. Quantiles will appear if `show_titles=True` and `quantiles` is set.
affects: all
gotchaCorner plots are memory-intensive for very large datasets (millions of points). Consider thinning your samples before plotting.
fix
Subsample your data: `samples = samples[::10]`
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'corner' from 'corner'
Attempting to import `corner` as a function instead of a module.
fix
Use `import corner` then call `corner.corner(samples)`.
ValueError: The number of truths (3) does not match the number of dimensions (2)
The `truths` list length differs from the number of columns in the samples array.
fix
Ensure `truths` has the same number of elements as `samples.shape[1]`.
TypeError: corner() got an unexpected keyword argument 'smooth'
Using deprecated `smooth` parameter in corner >=2.2.0.
fix
Use `smooth1d` and/or `smooth2d` instead.
No module named 'arviz' when using 'corner'
ArviZ is an optional dependency; some workflows may unexpectedly require it.
fix
Install with `pip install corner[arviz]` or pip install arviz.
Upgrade
Version history
2.2.3latest on PyPI · released Nov 23, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
corner — pip install corner · libregistry