Last change
on this file since 3295 was
2229,
checked in by steve, 19 years ago
|
Moved directories into production and development parent directories
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2229] | 1 | from pylab import * |
---|
| 2 | from vtk_pylab import * |
---|
| 3 | |
---|
| 4 | def func3(x,y): |
---|
| 5 | return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2) |
---|
| 6 | |
---|
| 7 | dx, dy = 0.025, 0.025 |
---|
| 8 | x = arange(-3.0, 3.0, dx) |
---|
| 9 | y = arange(-3.0, 3.0, dy) |
---|
| 10 | X, Y = meshgrid(x,y) |
---|
| 11 | Z = func3(X,Y) |
---|
| 12 | |
---|
| 13 | font = {'fontname' : 'Times', |
---|
| 14 | 'color' : 'r', |
---|
| 15 | 'fontweight' : 'normal', |
---|
| 16 | 'fontsize' : 10} |
---|
| 17 | |
---|
| 18 | #figure(figsize=(6,4)) |
---|
| 19 | |
---|
| 20 | if 1: |
---|
| 21 | ax = subplot(221) |
---|
| 22 | title('mesh using VTK', font, fontsize=14, color='r') |
---|
| 23 | text(80, 0.65, 'rf. pcolor_demo', font, color='w') |
---|
| 24 | mesh(X,Y,Z, 0) |
---|
| 25 | vtkRotX(-45) |
---|
| 26 | vtkRender() |
---|
| 27 | vtkImage() |
---|
| 28 | imshow(im,None) |
---|
| 29 | axis('off') |
---|
| 30 | |
---|
| 31 | if 1: |
---|
| 32 | ax = subplot(222) |
---|
| 33 | title('mesh colored using VTK', font, fontsize=14, color='r') |
---|
| 34 | text(80, 0.65, 'rf. pcolor_demo', font, color='w') |
---|
| 35 | vtkClear() |
---|
| 36 | mesh(X,Y,Z, 1) |
---|
| 37 | # vtkRotX(-45) |
---|
| 38 | vtkRender() |
---|
| 39 | vtkImage() |
---|
| 40 | imshow(im,None) |
---|
| 41 | axis('off') |
---|
| 42 | |
---|
| 43 | if 1: |
---|
| 44 | ax = subplot(223) |
---|
| 45 | title('plot3 using VTK', font, fontsize=14, color='r') |
---|
| 46 | vtkClear() |
---|
| 47 | dt = pi/50.0 |
---|
| 48 | t = arange(0.0, 10*pi, dt) |
---|
| 49 | plot3(sin(t),cos(t),t) |
---|
| 50 | vtkRotX(-70) |
---|
| 51 | vtkPerspective(0) |
---|
| 52 | # grid(0) |
---|
| 53 | vtkRender() |
---|
| 54 | vtkImage() |
---|
| 55 | imshow(im,None) |
---|
| 56 | axis('off') |
---|
| 57 | |
---|
| 58 | #savefig('vtkfig1') |
---|
| 59 | show() |
---|
| 60 | |
---|
Note: See
TracBrowser
for help on using the repository browser.