Attachment 'mat3d_ex4.py'
Download 1 #!/usr/bin/env python
2 """Simple example for showing surface mesh functionality, this example uses default colormap in reverse
3 Variables that can be set in mat3d.mesh :
4 colors = Colors - Sets the colormap
5 linewidth = 0.1 - Sets the width of the plotlines
6 precision=3 - Sets the number of digits accuracy for the text on the axis
7 num_ticks=5 - Number of ticks on axes, evenly spaced
8 fill_mesh = 0 - If one, fills the mesh with the colormap in colors"""
9
10 import numpy as N
11 import mat3d as M
12
13 # Set mesh configuration
14 x0,x1,npts_x = -1.0,1.1,11
15 y0,y1,npts_y = -1.0,1.1,11
16
17 # N.mgrid requires the stepsize in the call
18 x_delta = (x1-x0)/float(npts_x)
19 y_delta = (y1-y0)/float(npts_y)
20
21 X,Y = N.mgrid[x0:x1:0.1,y0:y1:0.1]
22 Z = X * N.exp(-X**2 - Y**2)
23
24 NewCl = N.array([[172.0, 201.0,86.0],[115.0, 201.0,86.0],[86.0,201.0,115.0],[86.0, 201.0,172.0],[86.0, 172.0,201.0],[86.0,115.0,201.0],[115.0, 86.0,201.0],[172.0, 86.0,201.0],[201.0, 86.0,172.0],[201.0,86.0,89.0],[201.0, 115.0,86.0],[201.0, 172.0,86.0]])/256
25 x = M.mesh(X,Y,Z,NewCl, fill_mesh=1)
New Attachment
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2006-10-05 15:26:19, 28.1 KB) [[attachment:Lines.png]]
- [get | view] (2006-10-05 15:26:09, 36.5 KB) [[attachment:Mesh.png]]
- [get | view] (2006-10-05 15:25:55, 31.8 KB) [[attachment:Sphere1.png]]
- [get | view] (2006-10-12 11:38:56, 41.6 KB) [[attachment:mat3d.py]]
- [get | view] (2006-10-30 13:51:24, 6.8 KB) [[attachment:mat3d.tar.gz]]
- [get | view] (2006-10-30 13:51:06, 9.0 KB) [[attachment:mat3d.zip]]
- [get | view] (2006-09-28 14:46:51, 0.5 KB) [[attachment:mat3d_ex1.py]]
- [get | view] (2006-09-28 14:46:57, 0.6 KB) [[attachment:mat3d_ex2.py]]
- [get | view] (2006-09-28 14:47:03, 0.7 KB) [[attachment:mat3d_ex3.py]]
- [get | view] (2007-01-21 09:50:26, 109.2 KB) [[attachment:mat3d_ex4]]
- [get | view] (2007-01-21 09:55:15, 109.2 KB) [[attachment:mat3d_ex4.png]]
- [get | view] (2006-09-28 14:47:10, 1.1 KB) [[attachment:mat3d_ex4.py]]
- [get | view] (2006-09-28 14:47:22, 0.8 KB) [[attachment:mat3d_ex5.py]]
- [get | view] (2006-09-28 14:47:30, 0.5 KB) [[attachment:mat3d_ex6.py]]
- [get | view] (2006-10-12 11:38:30, 815.7 KB) [[attachment:screenshot.gif]]
- [get | view] (2006-09-28 14:47:50, 105.2 KB) [[attachment:screenshot.png]]