Revision: 4858
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4858&view=rev
Author:   jswhit
Date:     2008-01-10 11:32:16 -0800 (Thu, 10 Jan 2008)

Log Message:
-----------
remove duplicate data files, change import to mpl_toolkits.

Modified Paths:
--------------
    trunk/htdocs/screenshots/contour_shot.py
    trunk/htdocs/screenshots/plotmap.py

Removed Paths:
-------------
    trunk/htdocs/screenshots/etopo20data.gz
    trunk/htdocs/screenshots/etopo20lats.gz
    trunk/htdocs/screenshots/etopo20lons.gz

Modified: trunk/htdocs/screenshots/contour_shot.py
===================================================================
--- trunk/htdocs/screenshots/contour_shot.py    2008-01-10 18:38:56 UTC (rev 
4857)
+++ trunk/htdocs/screenshots/contour_shot.py    2008-01-10 19:32:16 UTC (rev 
4858)
@@ -1,17 +1,14 @@
-from matplotlib.toolkits.basemap import Basemap, interp
+from mpl_toolkits.basemap import Basemap, interp
 from pylab import *
-import cPickle
 
 # read in data on lat/lon grid.
-hgt = array(load('data/500hgtdata.gz'),'d')
-lons = array(load('data/500hgtlons.gz'),'d')
-lats = array(load('data/500hgtlats.gz'),'d')
+hgt = load('data/500hgtdata.gz')
+lons = load('data/500hgtlons.gz')
+lats = load('data/500hgtlats.gz')
 lons, lats = meshgrid(lons,lats)
 
 # set up map projection (lambert azimuthal equal area).
-m = Basemap(-135.,-20.,45.,-20.,
-             resolution='c',area_thresh=10000.,projection='laea',
-             lat_0=90.,lon_0=-90.)
+m = Basemap(projection='nplaea',lon_0=-90,boundinglat=15.,resolution='c')
 
 cmap = cm.jet
 fig = figure(figsize=(6,6))
@@ -19,8 +16,8 @@
 ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
 
 x,y = m(lons, lats)
-cs = contour(x,y,hgt,15,linewidths=0.5,colors='k')
-cs = contourf(x,y,hgt,15,cmap=cmap,colors=None)
+cs = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
+cs = m.contourf(x,y,hgt,15,cmap=cm.jet)
 
 # draw map.
 m.drawcoastlines()

Deleted: trunk/htdocs/screenshots/etopo20data.gz
===================================================================
(Binary files differ)

Deleted: trunk/htdocs/screenshots/etopo20lats.gz
===================================================================
(Binary files differ)

Deleted: trunk/htdocs/screenshots/etopo20lons.gz
===================================================================
(Binary files differ)

Modified: trunk/htdocs/screenshots/plotmap.py
===================================================================
--- trunk/htdocs/screenshots/plotmap.py 2008-01-10 18:38:56 UTC (rev 4857)
+++ trunk/htdocs/screenshots/plotmap.py 2008-01-10 19:32:16 UTC (rev 4858)
@@ -4,15 +4,15 @@
 
 # the data is interpolated to the native projection grid.
 
-from matplotlib.toolkits.basemap import Basemap, shiftgrid
+from mpl_toolkits.basemap import Basemap, shiftgrid
 from pylab import title, colorbar, show, axes, cm, load, arange, figure, \
                   text
 
 # read in topo data (on a regular lat/lon grid)
 # longitudes go from 20 to 380.
-topoin = load('etopo20data.gz')
-lons = load('etopo20lons.gz')
-lats = load('etopo20lats.gz')
+topoin = load('data/etopo20data.gz')
+lons = load('data/etopo20lons.gz')
+lats = load('data/etopo20lats.gz')
 # shift data so lons go from -180 to 180 instead of 20 to 380.
 topoin,lons = shiftgrid(180.,topoin,lons,start=False)
 
@@ -32,7 +32,11 @@
 # plot image over map with imshow.
 im = m.imshow(topodat,cm.jet)
 # setup colorbar axes instance.
-l,b,w,h = ax.get_position()
+# for matplotlib 0.91 and earlier, could do l,b,w,h = ax.get_position()
+# for post 0.91, pos = ax.get_position(); l,b,w,h = pos.bounds
+# this works for both.
+pos = ax.get_position()
+l, b, w, h = getattr(pos, 'bounds', pos)
 cax = axes([l+w+0.075, b, 0.05, h])
 colorbar(cax=cax) # draw colorbar
 axes(ax)  # make the original axes current again


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to