From: <js...@us...> - 2007-12-03 13:27:35
|
Revision: 4558 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4558&view=rev Author: jswhit Date: 2007-12-03 05:27:16 -0800 (Mon, 03 Dec 2007) Log Message: ----------- more cleanups of example scripts Modified Paths: -------------- trunk/py4science/examples/basemap1.py trunk/py4science/examples/basemap2.py trunk/py4science/examples/basemap3.py trunk/py4science/examples/basemap4.py trunk/py4science/examples/basemap5.py Modified: trunk/py4science/examples/basemap1.py =================================================================== --- trunk/py4science/examples/basemap1.py 2007-12-03 13:20:19 UTC (rev 4557) +++ trunk/py4science/examples/basemap1.py 2007-12-03 13:27:16 UTC (rev 4558) @@ -1,12 +1,8 @@ import pylab, numpy from matplotlib.toolkits.basemap import Basemap -# create figure. -fig = pylab.figure() # create map by specifying lat/lon values at corners. -resolution = 'l' -projection = 'lcc' -lat_0 = 60 -lon_0 = -50 +resolution = 'l'; projection = 'lcc' +lat_0 = 60; lon_0 = -50 llcrnrlat, llcrnrlon = 8, -92 urcrnrlat, urcrnrlon = 39, 63 m = Basemap(lat_0=lat_0,lon_0=lon_0,\ Modified: trunk/py4science/examples/basemap2.py =================================================================== --- trunk/py4science/examples/basemap2.py 2007-12-03 13:20:19 UTC (rev 4557) +++ trunk/py4science/examples/basemap2.py 2007-12-03 13:27:16 UTC (rev 4558) @@ -1,14 +1,9 @@ import pylab, numpy from matplotlib.toolkits.basemap import Basemap -# create figure. -fig = pylab.figure() # create map by specifying width and height in km. -resolution = 'l' -projection = 'lcc' -lon_0 = -50 -lat_0 = 60 -width = 12000000 -height = 0.75*width +resolution = 'l'; projection = 'lcc' +lon_0 = -50; lat_0 = 60 +width = 12000000; height = 0.75*width m = Basemap(lon_0=lon_0,lat_0=lat_0,\ width=width,height=height,\ resolution=resolution,projection=projection) Modified: trunk/py4science/examples/basemap3.py =================================================================== --- trunk/py4science/examples/basemap3.py 2007-12-03 13:20:19 UTC (rev 4557) +++ trunk/py4science/examples/basemap3.py 2007-12-03 13:27:16 UTC (rev 4558) @@ -1,16 +1,10 @@ import pylab, numpy from matplotlib.toolkits.basemap import Basemap -# create figure. -fig = pylab.figure() # create map by specifying width and height in km. -resolution = 'l' -lon_0 = -50 -lat_0 = 60 -projection = 'lcc' -width = 12000000 -height = 0.75*width -m = Basemap(lon_0=lon_0,lat_0=lat_0,\ - width=width,height=height,\ +resolution = 'l'; projection = 'lcc' +lon_0 = -50; lat_0 = 60 +width = 12000000; height = 0.75*width +m = Basemap(lon_0=lon_0,lat_0=lat_0,width=width,height=height, resolution=resolution,projection=projection) # nylat, nylon are lat/lon of New York nylat = 40.78 Modified: trunk/py4science/examples/basemap4.py =================================================================== --- trunk/py4science/examples/basemap4.py 2007-12-03 13:20:19 UTC (rev 4557) +++ trunk/py4science/examples/basemap4.py 2007-12-03 13:27:16 UTC (rev 4558) @@ -1,7 +1,5 @@ import pylab, numpy from matplotlib.toolkits.basemap import Basemap -# create figure. -fig = pylab.figure() # create map by specifying width and height in km. resolution = 'l' lon_0 = -50 @@ -9,8 +7,7 @@ projection = 'lcc' width = 12000000 height = 0.75*width -m = Basemap(lon_0=lon_0,lat_0=lat_0,\ - width=width,height=height,\ +m = Basemap(lon_0=lon_0,lat_0=lat_0,width=width,height=height, resolution=resolution,projection=projection) m.drawcoastlines(linewidth=0.5) m.drawmapboundary(fill_color='aqua') Modified: trunk/py4science/examples/basemap5.py =================================================================== --- trunk/py4science/examples/basemap5.py 2007-12-03 13:20:19 UTC (rev 4557) +++ trunk/py4science/examples/basemap5.py 2007-12-03 13:27:16 UTC (rev 4558) @@ -7,8 +7,6 @@ sst = ncfile.variables['analysed_sst'][:] lats = ncfile.variables['lat'][:] lons = ncfile.variables['lon'][:] -# set colormap -cmap = pylab.cm.gist_ncar # create Basemap instance for mollweide projection. # coastlines not used, so resolution set to None to skip # continent processing (this speeds things up a bit) @@ -16,7 +14,7 @@ # compute map projection coordinates of grid. x, y = m(*numpy.meshgrid(lons, lats)) # plot with pcolor -im = m.pcolormesh(x,y,sst,shading='flat',cmap=cmap) +im = m.pcolormesh(x,y,sst,shading='flat',cmap=pylab.cm.gist_ncar) # draw parallels and meridians, but don't bother labelling them. m.drawparallels(numpy.arange(-90.,120.,30.)) m.drawmeridians(numpy.arange(0.,420.,60.)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |