import numpy as np import matplotlib.pyplot as plt # data = np.random.randn(1000) # plt.hist(data, bins=50) # plt.show() mean = [0, 0] cov = [[1, 1], [1, 2]] x, y = np.random.multivariate_normal(mean, cov, 10000).T # plt.hist2d(x, y, bins=30, cmap="Blues") plt.hexbin(x, y, gridsize=30, cmap="Oranges") cb = plt.colorbar() cb.set_label("counts in bin") plt.show()