c
! www.simula.no/˜hpl
Basic Easyviz example
from scitools.all import
*
#importnumpyandplotting
t=linspace(0,3,51) #51pointsbetween0and3
y=t
**
2
*
exp(-t
**
2) # vectorized expression
plot(t, y)
hardcopy(’tmp1.eps’) # make PostScript image for reports
hardcopy(’tmp1.png’) # make PNG image for web pages
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0 0.5 1 1.5 2 2.5 3
Numerical Python – p. 260/728
Komentáře k této Příručce