1import numpy as np
2import matplotlib.pyplot as plt
3%matplotlib inline
4
5xedges = [0, 1, 2, 3]
6yedges = [0, 1, 2, 3, 4]
7x = np.array([0, 0.1, 0.2, 1., 1.1, 2., 2.1])
8y = np.array([0, 0.1, 0.2, 1., 1.1, 2., 3.3])
9
10out = np.histogram2d(x, y, bins=(xedges, yedges))
11
12plt.scatter(x, y)
13plt.grid()