Menu

[r4647]: / branches / transforms / examples / step_demo.py  Maximize  Restore  History

Download this file

27 lines (17 with data), 447 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import numpy as npy
from matplotlib.numerix import npyma as ma
from matplotlib.pyplot import step, legend, xlim, ylim, show
x = npy.arange(1, 7, 0.4)
y0 = npy.sin(x)
y = y0.copy() + 2.5
step(x, y, label='pre (default)')
y -= 0.5
step(x, y, where='mid', label='mid')
y -= 0.5
step(x, y, where='post', label='post')
y = ma.masked_where((y0>-0.15)&(y0<0.15), y - 0.5)
step(x,y, label='masked (pre)')
legend()
xlim(0, 7)
ylim(-0.5, 4)
show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.