{"id":21073,"library":"corner","title":"corner.py","description":"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.","status":"active","version":"2.2.3","language":"python","source_language":"en","source_url":"https://github.com/dfm/corner.py","tags":["corner-plot","visualization","mcmc","bayesian","matplotlib"],"install":[{"cmd":"pip install corner","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"corner.corner() is the main function; importing corner.corner directly is not recommended.","wrong":"from corner import corner","symbol":"corner","correct":"import corner"}],"quickstart":{"code":"import corner\nimport numpy as np\n\n# Generate random samples\nndim = 5\nnsamples = 10000\nnp.random.seed(42)\nsamples = np.random.randn(ndim * nsamples).reshape([nsamples, ndim])\n\n# Make the corner plot\nfigure = corner.corner(samples)\n\n# Save to file\nfigure.savefig(\"corner_plot.pdf\")","lang":"python","description":"Create a simple corner plot from random samples."},"warnings":[{"fix":"Capture the figure: `fig = corner.corner(...)` and use `fig.axes` to access subplots.","message":"The `corner.corner()` function returns a matplotlib `Figure` object, not a `GridSpec` or an array of axes. Do not try to unpack the return value.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use `smooth1d=...` and/or `smooth2d=...` instead of `smooth=...`.","message":"The `smooth` parameter for KDE smoothing is deprecated in favor of `smooth1d` and `smooth2d`.","severity":"deprecated","affected_versions":">=2.2.0"},{"fix":"Ensure `truths` has the same number of elements as the columns of `samples`.","message":"When passing `truths` (true parameter values), the list length must match the dimensionality of the samples (number of columns).","severity":"gotcha","affected_versions":"all"},{"fix":"Either omit `labels` or pass a list of label strings. Quantiles will appear if `show_titles=True` and `quantiles` is set.","message":"The `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.","severity":"gotcha","affected_versions":"all"},{"fix":"Subsample your data: `samples = samples[::10]`","message":"Corner plots are memory-intensive for very large datasets (millions of points). Consider thinning your samples before plotting.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `import corner` then call `corner.corner(samples)`.","cause":"Attempting to import `corner` as a function instead of a module.","error":"ImportError: cannot import name 'corner' from 'corner'"},{"fix":"Ensure `truths` has the same number of elements as `samples.shape[1]`.","cause":"The `truths` list length differs from the number of columns in the samples array.","error":"ValueError: The number of truths (3) does not match the number of dimensions (2)"},{"fix":"Use `smooth1d` and/or `smooth2d` instead.","cause":"Using deprecated `smooth` parameter in corner >=2.2.0.","error":"TypeError: corner() got an unexpected keyword argument 'smooth'"},{"fix":"Install with `pip install corner[arviz]` or pip install arviz.","cause":"ArviZ is an optional dependency; some workflows may unexpectedly require it.","error":"No module named 'arviz' when using 'corner'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}