.. _pylab_examples-hist2d_demo: pylab_examples example code: hist2d_demo.py =========================================== .. plot:: /home/tcaswell/src/p/matplotlib/doc/mpl_examples/pylab_examples/hist2d_demo.py :: 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) plt.show() Keywords: python, matplotlib, pylab, example, codex (see :ref:`how-to-search-examples`)