diff --git a/examples/pylab_examples/hist2d_demo.py b/examples/pylab_examples/hist2d_demo.py index 85ef27ad1d2b..f8f0e61cbe92 100644 --- a/examples/pylab_examples/hist2d_demo.py +++ b/examples/pylab_examples/hist2d_demo.py @@ -1,7 +1,8 @@ -from pylab import * -x = randn(1000) -y = randn(1000) + 5 +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 -hist2d(x, y, bins=40) -show() +plt.hist2d(x, y, bins=40) +plt.show()