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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/usr/bin/env python
# Example taken from:
# http://www.mathworks.fr/access/helpdesk/help/techdoc/ref/streamparticles.html
from scitools.easyviz import *
from time import sleep
from scipy import io
wind = io.loadmat('wind_matlab_v6.mat.gz')
x = wind['x']
y = wind['y']
z = wind['z']
u = wind['u']
v = wind['v']
w = wind['w']
setp(show=False)
sx, sy, sz = ndgrid([80]*36,seq(20,55,1),[5]*36)
sl = streamline(x,y,z,u,v,w,sx,sy,sz)
axis('tight')
view(30,30)
daspect([1,1,.125])
camproj('perspective')
camva(8)
box('on')
setp(show=True)
show()
figure()
# alternative syntax:
sl = streamline(x,y,z,u,v,w,sx,sy,sz,
axis='tight',
view=(30,30),
daspect=[1,1,.125],
camproj='perspective',
camva=8,
box='on')
raw_input('Press Return key to quit: ')
|