Revision: 6967
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6967&view=rev
Author: jswhit
Date: 2009-03-08 13:05:11 +0000 (Sun, 08 Mar 2009)
Log Message:
-----------
cosmetic changes.
Modified Paths:
--------------
trunk/toolkits/basemap/examples/plothighsandlows.py
Modified: trunk/toolkits/basemap/examples/plothighsandlows.py
===================================================================
--- trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-08 06:37:06 UTC
(rev 6966)
+++ trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-08 13:05:11 UTC
(rev 6967)
@@ -43,7 +43,8 @@
# (higher value, fewer highs and lows)
local_min, local_max = extrema(prmsl, mode='wrap', window=25)
# create Basemap instance.
-m =
Basemap(llcrnrlon=0,llcrnrlat=-65,urcrnrlon=360,urcrnrlat=65,projection='merc')
+m =\
+Basemap(llcrnrlon=0,llcrnrlat=-80,urcrnrlon=360,urcrnrlat=80,projection='mill')
# add wrap-around point in longitude.
prmsl, lons = addcyclic(prmsl, lons1)
# contour levels
@@ -56,8 +57,8 @@
cs = m.contour(x,y,prmsl,clevs,colors='k',linewidths=1.)
m.drawcoastlines(linewidth=1.25)
m.fillcontinents(color='0.8')
-m.drawparallels(np.arange(-80,81,20))
-m.drawmeridians(np.arange(0,360,60))
+m.drawparallels(np.arange(-80,81,20),labels=[1,1,0,0])
+m.drawmeridians(np.arange(0,360,60),labels=[0,0,0,1])
xlows = x[local_min]; xhighs = x[local_max]
ylows = y[local_min]; yhighs = y[local_max]
lowvals = prmsl[local_min]; highvals = prmsl[local_max]
@@ -65,6 +66,7 @@
xyplotted = []
# don't plot if there is already a L or H within dmin meters.
dmin = 500000
+yoffset = 0.022*(m.ymax-m.ymin)
for x,y,p in zip(xlows, ylows, lowvals):
if x < m.xmax and x > m.xmin and y < m.ymax and y > m.ymin:
dist = [np.sqrt((x-x0)**2+(y-y0)**2) for x0,y0 in xyplotted]
@@ -72,7 +74,7 @@
plt.text(x,y,'L',fontsize=14,fontweight='bold',
horizontalalignment='center',
verticalalignment='center',color='blue')
- plt.text(x,y-400000,repr(int(p)),fontsize=9,
+ plt.text(x,y-yoffset,repr(int(p)),fontsize=9,
horizontalalignment='center',
verticalalignment='top',color='blue')
xyplotted.append((x,y))
@@ -85,7 +87,7 @@
plt.text(x,y,'H',fontsize=14,fontweight='bold',
horizontalalignment='center',
verticalalignment='center',color='red')
- plt.text(x,y-400000,repr(int(p)),fontsize=9,
+ plt.text(x,y-yoffset,repr(int(p)),fontsize=9,
horizontalalignment='center',
verticalalignment='top',color='red')
xyplotted.append((x,y))
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins