The following program seems to work with contour/contourf. However the 
documentation for the contourf function states

contour(X,Y,Z)

"X, Y, and Z must be arrays with the same dimensions."

I am finding that contour works if the dimension of X and Y are 1, but Z must 
be two-dimensional. The following program seems to bear this out. Are the 
arrays x and y below two-dimensional, or is the documentation misleading? 
Thanks for your help.

import numpy as N
import pylab as PLT

lons = N.linspace(-5.,5.,5) # Is this a one or two dimensional array?
lats = N.linspace(-3.,3.,4)

z = N.zeros((len(lats), len(lons)))
for i in range(len(lons)):
    for j in range(len(lats)):
        z[j,i]=i+j

PLT.clf()
PLT.contourf(lons,lats,z)
PLT.colorbar()
PLT.show()

-Tony

--
Tony Mannucci
Supervisor, Ionospheric and Atmospheric Remote Sensing Group
 Mail-Stop 138-308,                     Tel > (818) 354-1699
 Jet Propulsion Laboratory,              Fax > (818) 393-5115
 California Institute of Technology,     Email > 
tony.mannu...@jpl.nasa.gov<mailto:tony.mannu...@jpl.nasa.gov>
 4800 Oak Grove Drive,                   http://genesis.jpl.nasa.gov
 Pasadena, CA 91109

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to