You are reading an old version of the documentation (v1.5.3). For the latest version see

Matplotlib 2.0.0rc2 is available

Install the release candidate now!



This Page

pylab_examples example code: hist2d_demo.pyΒΆ

(Source code, png, hires.png, pdf)

import matplotlib.pyplot as plt
import numpy as np
x = np.random.randn(1000)
y = np.random.randn(1000) + 5

# normal distribution center at x=0 and y=5
plt.hist2d(x, y, bins=40)

Keywords: python, matplotlib, pylab, example, codex (see Search examples)