> Shu:  I'd make a mask by finding the points on the grid that are outside 
> your polygon.  Then use that mask to create a masked array from your 
> data (masking the points you don't want to plot).  matplotlib's contourf 
> knows how to deal with masked arrays (at least when the masked region 
> isn't too complicated).  The basemap toolkit can plot data on map 
> projections with coastlines and political boundaries (as in the PyNGL 
> example you forwarded).
> 
> -Jeff

Thanks Jeff.Following your advice I have successed to get a masked
contour plot.Matplotlib can do it good.

in my case,
x is array for axis X and y for axis Y
z is data for contour
mask is a mask array with the same dimensions as z.
ma.array(z,mask=mask)
contour(x,y,z)

In my case,I used kriging interpolation to interpolate an array of
irregulation station data into a rectangular grid first and then plot
contour with matplotlib. I wanna know if matplotlib have such
interpolation functions or geostatistics functions. 

Thanks again.

 shu




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to