mirror of
https://github.com/wahyd4/code-sandbox.git
synced 2026-08-09 05:07:03 +10:00
17 lines
367 B
Python
17 lines
367 B
Python
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()
|