Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16bea07

Browse files
committed
Merge pull request #4642 from jenshnielsen/fix-and-classify-equal_aspect_ratio_rebase
Fixed and classified equal_aspect_ratio.py
2 parents 31e689a + b08ddb5 commit 16bea07

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

examples/pylab_examples/equal_aspect_ratio.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
Example: simple line plot.
44
Show how to make a plot that has equal aspect ratio
55
"""
6-
from pylab import *
6+
import matplotlib.pyplot as plt
7+
import numpy as np
78

8-
t = arange(0.0, 1.0 + 0.01, 0.01)
9-
s = cos(2*2*pi*t)
10-
plot(t, s, '-', lw=2)
9+
t = np.arange(0.0, 1.0 + 0.01, 0.01)
10+
s = np.cos(2*2*np.pi*t)
11+
plt.plot(t, s, '-', lw=2)
1112

12-
xlabel('time (s)')
13-
ylabel('voltage (mV)')
14-
title('About as simple as it gets, folks')
15-
grid(True)
13+
plt.xlabel('time (s)')
14+
plt.ylabel('voltage (mV)')
15+
plt.title('About as simple as it gets, folks')
16+
plt.grid(True)
1617

17-
axes().set_aspect('equal', 'datalim')
18+
plt.axes().set_aspect('equal', 'datalim')
1819

1920

20-
show()
21+
plt.show()

0 commit comments

Comments
 (0)