Hexbin plot with marginal distributionsΒΆ

../_images/hexbin_marginals.png

Python source code: [download source: hexbin_marginals.py]

import numpy as np
from scipy.stats import kendalltau
import seaborn as sns
sns.set(style="ticks")

rs = np.random.RandomState(11)
x = rs.gamma(2, size=1000)
y = -.5 * x + rs.normal(size=1000)

sns.jointplot(x, y, kind="hex", stat_func=kendalltau, color="#4CB391")