Skip to main content

Cornerplots

Simple library to create corner plots in matplotlib. Corner plots provide a simple way to visualize multidimensional data, with each dimension plotted against every other dimension. The main goal is to let the user specify data and/or model predictions in arbitrary subsets of the multi-dimensional space and let the code take care of where to plot these values. Originally inspired by corner.py.

Simple example

You might have one set of (w, x, y) data, another set of (x, y, z) data, and a model predicting (w, x, y, z) trajectories.

import numpy as np

t = np.linspace(0, 1)
model = dict(
    w = 3 * t + 1,
    x = 5 * t,
    y = 7 * t**.5,
    z = 3 * t**1.5,
    )

red_data = dict(
    w = np.array([1, 2, 3, 4]),
    x = np.array([0, 2, 4, 5]),
    y = np.array([1, 4, 6, 8]),
    )

blue_data = dict(
    x = np.array([1, 2, 5]),
    y = np.array([3, 5, 7]),
    z = np.array([0, 1, 3]),
    )

In that case, you could plot everything by simply calling:

from cornerplots import Cornerplots
import matplotlib.pyplot as ppl

fig = ppl.figure(figsize = (5,5))

cp = Cornerplots(
    fields = ['w', 'x', 'y', 'z'],
    labels = ['W-value', 'X-value', 'Y-value', 'Z-value'],
    grid_kwargs = {'alpha': 0.25, 'lw': 0.7},
    )

cp.plot(model,     'k-', lw = 1, dashes = (6,2,2,2), label = 'model')
cp.plot(red_data,  'ws', mec = 'r', mew = 1, ms = 5, label = 'red data')
cp.plot(blue_data, 'wD', mec = 'b', mew = 1, ms = 5, label = 'blue data')

cp.legend()

ppl.savefig('example.png')

Release files for cornerplots 1.0

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

Source distribution (sdist)

Source distribution for cornerplots 1.0
File Size Uploaded
cornerplots-1.0.tar.gz 32.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cornerplots 1.0
File Interpreter ABI Platform
cornerplots-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.2 kB

Release files / cornerplots-1.0.tar.gz

Download URL cornerplots-1.0.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
491a8f0b46e2b2b4ac413a22ea20c080c20193fee61c8c53ad64b395b356323b
BLAKE2b-256 checksum
How to use checksums
830803f6b6b2adbd95ea3df345373bb826580e25a8fa65bcf349a7125be36daf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / cornerplots-1.0-py3-none-any.whl

Download URL cornerplots-1.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a86461d8b38e2cf69f06d22beecea18f30c6f9898f78ab6a332571ec037bdf1c
BLAKE2b-256 checksum
How to use checksums
eab8e3e783e6e5cda57ea43cae5b96ce96d873a814801dff7c46e75b85f3a7db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

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