Gregory Ashton committed Dec 14, 2017 1 ``````# Grid corner plot `````` Gregory Ashton committed Oct 15, 2017 2 `````` `````` Gregory Ashton committed Dec 14, 2017 3 ``````A corner plot for an array of dependent values `````` Gregory Ashton committed Oct 15, 2017 4 `````` `````` Gregory Ashton committed Dec 14, 2017 5 ``````Given an N-dimensional set of data (i.e. some function evaluated over a grid `````` Gregory Ashton committed Oct 15, 2017 6 ``````of coordinates), plot all possible 1D and 2D projections in the style of a `````` Gregory Ashton committed Dec 14, 2017 7 ``````["corner" plot](http://corner.readthedocs.io/en/latest/pages/quickstart.html). `````` Gregory Ashton committed Oct 15, 2017 8 `````` `````` Gregory Ashton committed Dec 14, 2017 9 10 11 ``````## Installation Clone the repository and then ```bash `````` David Keitel committed Dec 18, 2017 12 13 14 15 16 ``````\$ python setup.py install ``` or add a prefix to install in userspace, e.g. ```bash \$ python setup.py install --prefix=~/.local/ `````` Gregory Ashton committed Dec 14, 2017 17 18 19 ````````` ## Example `````` Gregory Ashton committed Oct 15, 2017 20 21 22 23 24 `````` Generating some fake data and plotting: ```python import numpy as np `````` Gregory Ashton committed Dec 14, 2017 25 ``````import gridcorner `````` Gregory Ashton committed Oct 15, 2017 26 27 28 29 30 31 32 33 34 35 36 37 38 39 `````` # Generate example data x = np.linspace(0, 1, 50) y = np.linspace(20, 30, 60) z = np.linspace(-2, -1, 70) x0, y0, z0 = 0.5, 22, -1.5 X, Y, Z = np.meshgrid(x, y, z, indexing='ij') sigmax = 0.1 sigmay = 1 sigmaz = 0.2 D = (np.exp(-(X-x0)**2/sigmax**2) + np.exp(-(Y-y0)**2/sigmay**2) + np.exp(-(Z-z0)**2/sigmaz**2)) `````` Gregory Ashton committed Dec 14, 2017 40 41 ``````fig, axes = gridcorner.gridcorner( D, xyz=[x, y, z], labels=['x', 'y', 'z', 'D'], projection='log_mean') `````` Gregory Ashton committed Oct 15, 2017 42 43 44 45 ``````fig.savefig('example') ``` ![Example plot](example.png) `````` Gregory Ashton committed Dec 14, 2017 46 ``````## Acknowledgements `````` Gregory Ashton committed Oct 15, 2017 47 48 49 50 `````` The code uses both the central idea and some specific code from [corner.py](https://github.com/dfm/corner.py) ``````