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

Skip to content

Commit 7bc18fd

Browse files
committed
MEP12 on step_demo.py
1 parent eef24e5 commit 7bc18fd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/pylab_examples/step_demo.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import numpy as np
22
from numpy import ma
3-
from matplotlib.pyplot import step, legend, xlim, ylim, show
3+
import matplotlib.pyplot as plt
44

55
x = np.arange(1, 7, 0.4)
66
y0 = np.sin(x)
77
y = y0.copy() + 2.5
88

9-
step(x, y, label='pre (default)')
9+
plt.step(x, y, label='pre (default)')
1010

1111
y -= 0.5
12-
step(x, y, where='mid', label='mid')
12+
plt.step(x, y, where='mid', label='mid')
1313

1414
y -= 0.5
15-
step(x, y, where='post', label='post')
15+
plt.step(x, y, where='post', label='post')
1616

1717
y = ma.masked_where((y0 > -0.15) & (y0 < 0.15), y - 0.5)
18-
step(x, y, label='masked (pre)')
18+
plt.step(x, y, label='masked (pre)')
1919

20-
legend()
20+
plt.legend()
2121

22-
xlim(0, 7)
23-
ylim(-0.5, 4)
22+
plt.xlim(0, 7)
23+
plt.ylim(-0.5, 4)
2424

25-
show()
25+
plt.show()

0 commit comments

Comments
 (0)