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

Skip to content

Commit 8369c9c

Browse files
committed
make step_demo use npyma
svn path=/trunk/matplotlib/; revision=4113
1 parent 3fd13b3 commit 8369c9c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

examples/step_demo.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as npy
2-
from pylab import *
2+
from matplotlib.numerix import npyma as ma
3+
from matplotlib.pyplot import step, legend, xlim, ylim, show
34

45
x = npy.arange(1, 7, 0.4)
56
y0 = npy.sin(x)
@@ -13,7 +14,7 @@
1314
y -= 0.5
1415
step(x, y, where='post', label='post')
1516

16-
y = npy.ma.masked_where((y0>-0.15)&(y0<0.15), y - 0.5)
17+
y = ma.masked_where((y0>-0.15)&(y0<0.15), y - 0.5)
1718
step(x,y, label='masked (pre)')
1819

1920
legend()
@@ -22,3 +23,4 @@
2223
ylim(-0.5, 4)
2324

2425
show()
26+

0 commit comments

Comments
 (0)