Revision: 4425
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4425&view=rev
Author: jswhit
Date: 2007-11-23 05:38:46 -0800 (Fri, 23 Nov 2007)
Log Message:
-----------
update example
Modified Paths:
--------------
trunk/py4science/examples/basemap5.py
Modified: trunk/py4science/examples/basemap5.py
===================================================================
--- trunk/py4science/examples/basemap5.py 2007-11-23 13:38:18 UTC (rev
4424)
+++ trunk/py4science/examples/basemap5.py 2007-11-23 13:38:46 UTC (rev
4425)
@@ -16,7 +16,12 @@
lat_0 = lats.mean()
# set colormap
cmap = pylab.cm.gist_ncar
+# set so masked values in an image will be black
+# (i.e. continents will be painted this color)
+cmap.set_bad('k')
# create Basemap instance for mollweide projection.
+# coastlines not used, so resolution set to None to skip
+# continent processing (this speeds things up a bit)
m = Basemap(projection='moll',lon_0=lon_0,lat_0=lat_0,resolution='l')
# compute map projection coordinates of grid.
x, y = m(*numpy.meshgrid(lons, lats))
@@ -25,9 +30,7 @@
#CS = m.contourf(x,y,sst,20,cmap=cmap)
# plot with pcolor
im = m.pcolormesh(x,y,sst,shading='flat',cmap=cmap)
-# fill the continents (data is not defined there).
-m.fillcontinents(color='k',lake_color='k')
-# draw parallels and meridians.
+# draw parallels and meridians, but don't bother labelling them.
m.drawparallels(numpy.arange(-90.,120.,30.))
m.drawmeridians(numpy.arange(0.,420.,60.))
# draw line around map projection limb.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins