Hi!
I try to plot some interpolated data on a map and get an error saying
there are too many indices. When I use contour in matplotlib without
basemap I don't get the error. Also the map without a contour plot on it
works. Maybe some of you know what I do wrong?

Here is my code:
-------------
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import griddata
from mpl_toolkits.basemap import Basemap
 

yi = np.linspace(min(Lat),max(Lat),100)
xi = np.linspace(min(Lon),max(Lon),50)
lon,lat,var = np.array(Lon), np.array(Lat), np.array(Var)
zi = griddata(lon,lat,var,xi,yi)

map = Basemap(projection='cyl', llcrnrlat=67, urcrnrlat=73,\
           llcrnrlon=4, urcrnrlon=20, resolution='h')
 

map.drawcoastlines()

map.drawmeridians(np.arange(0,360,1))
map.drawparallels(np.arange(-90,90,1))

xlon, ylat = map(xi,yi)
cs = map.contour(xlon,ylat,zi)

plt.show()
---------------

and this is the error message:

cs = map.contour(xlon,ylat,zi)
File
"/usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap/__init__.py",
line 2820, in contour
  xx = x[x.shape[0]/2,:]
IndexError: too many indices

Any help appreciated!
Sünnje
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to