diff --git a/examples/pylab_examples/equal_aspect_ratio.py b/examples/pylab_examples/equal_aspect_ratio.py index e2c5dd3056e9..b40aebe2f126 100755 --- a/examples/pylab_examples/equal_aspect_ratio.py +++ b/examples/pylab_examples/equal_aspect_ratio.py @@ -3,18 +3,19 @@ Example: simple line plot. Show how to make a plot that has equal aspect ratio """ -from pylab import * +import matplotlib.pyplot as plt +import numpy as np -t = arange(0.0, 1.0 + 0.01, 0.01) -s = cos(2*2*pi*t) -plot(t, s, '-', lw=2) +t = np.arange(0.0, 1.0 + 0.01, 0.01) +s = np.cos(2*2*np.pi*t) +plt.plot(t, s, '-', lw=2) -xlabel('time (s)') -ylabel('voltage (mV)') -title('About as simple as it gets, folks') -grid(True) +plt.xlabel('time (s)') +plt.ylabel('voltage (mV)') +plt.title('About as simple as it gets, folks') +plt.grid(True) -axes().set_aspect('equal', 'datalim') +plt.axes().set_aspect('equal', 'datalim') -show() +plt.show()