image_make.py 664 Bytes
Newer Older
Jonathan Juhl's avatar
all  
Jonathan Juhl committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import numpy as np

import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import LogNorm
from scipy.stats.kde import gaussian_kde

a = np.random.multivariate_normal([0,0], [[ 1, 0], [0,  0.01]], check_valid='warn', tol=1e-8,size=[10000])

b = np.random.multivariate_normal([0,0], [[ 1,  0], [0,  0.01]],  check_valid='warn', tol=1e-8,size=[10000])

c = np.random.multivariate_normal([0,0], [[ 1, 0], [0, 0.01]],  check_valid='warn', tol=1e-8,size=[10000])

s = np.concatenate([a,b,c],axis=0)

x = s[:,0]

y = s[:,1]

H, xedges, yedges =np.histogram2d(x, y, bins=100)

plt.pcolormesh(xedges, yedges , H ,alpha=0.9)