Binder

1. Quickstart

cornerhex can be used to easily visualize multidimensional data in a hexbin matrix plot, for example the results of Marcov Chain Monte Carlo (MCMC) methods.

Creating random data

We first need to create some random multi-dimensional data. For this purpose we create a random covariance matrix with 4 dimensions and pick 50000 random samples.

[1]:
Ndims, Nsamples = 4, 50_000
[2]:
import numpy as np

D = 2.*np.random.rand(Ndims, Ndims)-1.
cov = np.dot(D, D.T)
mean = 20.*np.random.rand(Ndims) - 10.

data = np.random.multivariate_normal(mean, cov, size=Nsamples)

Creating cornerhex plot

This data array can be directly fed into cornerhex.cornerplot.

[3]:
from cornerhex import cornerplot

cornerplot(data);
_images/1_quickstart_9_0.png

The next chapter discusses customizations of the cornerplot.