In [1]:
import time
print('Last updated:', time.strftime('%m/%d/%Y'))


Last updated: 06/27/2014

In [2]:
%matplotlib inline



Sections





Simple heat map


In [3]:
import numpy as np

# Sample from a bivariate Gaussian distribution
mean = [0,0]
cov = [[0,1],[1,0]] 
x, y = np.random.multivariate_normal(mean, cov, 10000).T

In [4]:
from matplotlib import pyplot as plt

hist, xedges, yedges = np.histogram2d(x,y)
X,Y = np.meshgrid(xedges,yedges)
plt.imshow(hist)
plt.grid(True)
plt.colorbar()
plt.show()



In [6]:
plt.imshow(hist, interpolation='nearest')
plt.grid(True)
plt.colorbar()
plt.show()



In [8]:
plt.hist2d(x, y, bins=10)
plt.colorbar()
plt.grid()
plt.show()



In [10]:
plt.hist2d(x, y, bins=40)
plt.colorbar()
plt.grid()
plt.show()



In [11]:
print('x min, x max:', x.min(), x.max())
print('y min, y max:', y.min(), y.max())


x min, x max: -3.61146247799 4.57871698099
y min, y max: -4.41903246154 3.40713659521

In [ ]: