This is an archival dump of old wiki content --- see scipy.org for current material

Attachment 'mat3d_ex5.py'

Download

   1 #!/usr/bin/env python
   2 """Simple example for showing surface mesh functionality
   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 from matplotlib import numerix as nu
  13 
  14 u = N.linspace(0, 2*N.pi,20)
  15 v = N.linspace(0, N.pi,20)
  16         
  17 x=nu.outerproduct(N.cos(u),N.sin(v))
  18 y=nu.outerproduct(N.sin(u),N.sin(v))
  19 z=nu.outerproduct(N.ones(N.size(u)), N.cos(v))
  20 
  21 # call the actual plotting routine
  22 x = M.mesh(x,y,z,fill_mesh=1,precision=1,num_ticks = 3)

New Attachment

File to upload
Rename to
Overwrite existing attachment of same name

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.