Menu

[r494]: / trunk / htdocs / examples / vline_demo.py  Maximize  Restore  History

Download this file

23 lines (17 with data), 480 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
from matplotlib.matlab import *
from matplotlib.numerix import sin, exp, multiply, absolute, pi
import matplotlib.numerix as numerix
normal = numerix.RandomArray.normal
def f(t):
s1 = sin(2*pi*t)
e1 = exp(-t)
return absolute(multiply(s1,e1))+.05
t = arange(0.0, 5.0, 0.1)
s = f(t)
nse = multiply(normal(0.0, 0.3, t.shape), s)
plot(t, s+nse, 'b^')
vlines(t, [0], s, color='k')
xlabel('time (s)')
title('Comparison of model with data')
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.