SF.net SVN: matplotlib:[6596] trunk/toolkits/basemap
Revision: 6596 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6596&view=rev Author: jswhit Date: 2008-12-13 14:43:02 + (Sat, 13 Dec 2008) Log Message: --- make sure fillcontinents returns a list of *all* Polygon instances (not just the last one). Modified Paths: -- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/Changelog === --- trunk/toolkits/basemap/Changelog2008-12-13 06:20:28 UTC (rev 6595) +++ trunk/toolkits/basemap/Changelog2008-12-13 14:43:02 UTC (rev 6596) @@ -1,4 +1,6 @@ version 0.99.3 (not yet released) + * fillcontinents was returning just last Polygon instance. + Now returns a list of all Polygon instances. * bluemarble: pass kwargs to imshow, return Image instance. version 0.99.2 (svn revision 6541) * fix drawlsmask method so that it works for cylindrical Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py === --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13 06:20:28 UTC (rev 6595) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13 14:43:02 UTC (rev 6596) @@ -1305,6 +1305,7 @@ # get axis background color. axisbgc = ax.get_axis_bgcolor() npoly = 0 +polys = [] for x,y in self.coastpolygons: xa = np.array(x,np.float32) ya = np.array(y,np.float32) @@ -1334,10 +1335,11 @@ if zorder is not None: poly.set_zorder(zorder) ax.add_patch(poly) +polys.append(poly) npoly = npoly + 1 # set axes limits to fit map region. self.set_axes_limits(ax=ax) -return poly +return polys def drawcoastlines(self,linewidth=1.,color='k',antialiased=1,ax=None,zorder=None): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6597] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py
Revision: 6597
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6597&view=rev
Author: jswhit
Date: 2008-12-13 14:46:30 + (Sat, 13 Dec 2008)
Log Message:
---
update docstrings.
Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13
14:43:02 UTC (rev 6596)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13
14:46:30 UTC (rev 6597)
@@ -1289,7 +1289,7 @@
After filling continents, lakes are re-filled with
axis background color.
-returns matplotlib.patches.Polygon object.
+returns a list of matplotlib.patches.Polygon objects.
"""
if self.resolution is None:
raise AttributeError, 'there are no boundary datasets associated
with this Basemap instance'
@@ -2632,6 +2632,8 @@
Extra keyword ``ax`` can be used to override the default axis instance.
Other \**kwargs passed on to matplotlib.pyplot.plot.
+
+returns an matplotlib.image.AxesImage instance.
"""
if not kwargs.has_key('ax') and self.ax is None:
try:
@@ -3159,6 +3161,8 @@
to downsample the image (``scale=0.5`` downsamples to 2700x1350).
\**kwargs passed on to :meth:`imshow`.
+
+returns an matplotlib.image.AxesImage instance.
"""
if ax is not None:
return
self.warpimage(image='bluemarble',ax=ax,scale=scale,**kwargs)
@@ -3186,6 +3190,8 @@
Extra keyword ``ax`` can be used to override the default axis instance.
\**kwargs passed on to :meth:`imshow`.
+
+returns an matplotlib.image.AxesImage instance.
"""
try:
from PIL import Image
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6598] trunk/toolkits/basemap
Revision: 6598
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6598&view=rev
Author: jswhit
Date: 2008-12-13 15:11:57 + (Sat, 13 Dec 2008)
Log Message:
---
make sure drawmapscale returns a list of plot objects.
Modified Paths:
--
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===
--- trunk/toolkits/basemap/Changelog2008-12-13 14:46:30 UTC (rev 6597)
+++ trunk/toolkits/basemap/Changelog2008-12-13 15:11:57 UTC (rev 6598)
@@ -1,4 +1,6 @@
version 0.99.3 (not yet released)
+ * make sure drawmapscale method returns a list of objects that
+ can be iterated over to remove them from the plot.
* fillcontinents was returning just last Polygon instance.
Now returns a list of all Polygon instances.
* bluemarble: pass kwargs to imshow, return Image instance.
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13
14:46:30 UTC (rev 6597)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13
15:11:57 UTC (rev 6598)
@@ -3043,6 +3043,8 @@
is used.
Extra keyword ``ax`` can be used to override the default axis instance.
+
+returns a matplotlib.image.AxesImage instance.
"""
# convert land and ocean colors to integer rgba tuples with
# values between 0 and 255.
@@ -3162,7 +3164,7 @@
\**kwargs passed on to :meth:`imshow`.
-returns an matplotlib.image.AxesImage instance.
+returns a matplotlib.image.AxesImage instance.
"""
if ax is not None:
return
self.warpimage(image='bluemarble',ax=ax,scale=scale,**kwargs)
@@ -3191,7 +3193,7 @@
\**kwargs passed on to :meth:`imshow`.
-returns an matplotlib.image.AxesImage instance.
+returns a matplotlib.image.AxesImage instance.
"""
try:
from PIL import Image
@@ -3433,6 +3435,7 @@
raise KeyError("labelstyle must be 'simple' or 'fancy'")
# default y offset is 2 percent of map height.
if yoffset is None: yoffset = 0.02*(self.ymax-self.ymin)
+rets = [] # will hold all plot objects generated.
# 'fancy' style
if barstyle == 'fancy':
#we need 5 sets of x coordinates (in map units)
@@ -3449,62 +3452,63 @@
ybottom = yc-yoffset/2
ytick = ybottom - yoffset/2
ytext = ytick - yoffset/2
-self.plot([x1,x4],[ytop,ytop],color=fontcolor)
+rets.append(self.plot([x1,x4],[ytop,ytop],color=fontcolor)[0])
#plot bottom line
-self.plot([x1,x4],[ybottom,ybottom],color=fontcolor)
+
rets.append(self.plot([x1,x4],[ybottom,ybottom],color=fontcolor)[0])
#plot left edge
-self.plot([x1,x1],[ybottom,ytop],color=fontcolor)
+rets.append(self.plot([x1,x1],[ybottom,ytop],color=fontcolor)[0])
#plot right edge
-self.plot([x4,x4],[ybottom,ytop],color=fontcolor)
+rets.append(self.plot([x4,x4],[ybottom,ytop],color=fontcolor)[0])
#make a filled black box from left edge to 1/4 way across
-ax.fill([x1,x2,x2,x1,x1],[ytop,ytop,ybottom,ybottom,ytop],\
-ec=fontcolor,fc=fillcolor1)
+
rets.append(ax.fill([x1,x2,x2,x1,x1],[ytop,ytop,ybottom,ybottom,ytop],\
+ec=fontcolor,fc=fillcolor1)[0])
#make a filled white box from 1/4 way across to 1/2 way across
-ax.fill([x2,xc,xc,x2,x2],[ytop,ytop,ybottom,ybottom,ytop],\
-ec=fontcolor,fc=fillcolor2)
+
rets.append(ax.fill([x2,xc,xc,x2,x2],[ytop,ytop,ybottom,ybottom,ytop],\
+ec=fontcolor,fc=fillcolor2)[0])
#make a filled white box from 1/2 way across to 3/4 way across
-ax.fill([xc,x3,x3,xc,xc],[ytop,ytop,ybottom,ybottom,ytop],\
-ec=fontcolor,fc=fillcolor1)
+
rets.append(ax.fill([xc,x3,x3,xc,xc],[ytop,ytop,ybottom,ybottom,ytop],\
+ec=fontcolor,fc=fillcolor1)[0])
#make a filled white box from 3/4 way across to end
-ax.fill([x3,x4,x4,x3,x3],[ytop,ytop,ybottom,ybottom,ytop],\
-ec=fontcolor,fc=fillcolor2)
+
rets.append(ax.fill([x3,x4,x4,x3,x3],[ytop,ytop,ybottom,ybottom,ytop],\
+ec=fontcolor,fc=fillcolor2)[0])
#plot 3 tick marks at left edge, center, and right edge
-self.plot([x1,x1],[ytick,ybottom],color=fontcolor)
-self.plot([xc,xc],[ytick,ybottom],color=fontcolor)
-self.plot([x4,
SF.net SVN: matplotlib:[6599] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py
Revision: 6599
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6599&view=rev
Author: jswhit
Date: 2008-12-13 17:45:00 + (Sat, 13 Dec 2008)
Log Message:
---
docstring update.
Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13
15:11:57 UTC (rev 6598)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13
17:45:00 UTC (rev 6599)
@@ -2185,7 +2185,9 @@
Extra keyword ``ax`` can be used to override the default axis instance.
-Other \**kwargs passed on to matplotlib.patches.Polygon."""
+Other \**kwargs passed on to matplotlib.patches.Polygon.
+
+returns a matplotlib.patches.Polygon object."""
if not kwargs.has_key('ax') and self.ax is None:
try:
ax = plt.gca()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6600] trunk/toolkits/basemap
Revision: 6600 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6600&view=rev Author: jswhit Date: 2008-12-13 18:03:10 + (Sat, 13 Dec 2008) Log Message: --- append LineCollection tuple to readshapefile return tuple. Modified Paths: -- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/Changelog === --- trunk/toolkits/basemap/Changelog2008-12-13 17:45:00 UTC (rev 6599) +++ trunk/toolkits/basemap/Changelog2008-12-13 18:03:10 UTC (rev 6600) @@ -1,4 +1,6 @@ version 0.99.3 (not yet released) + * if readshapefile is called with drawbounds=True, a + LineCollection object is appended to the returned tuple. * make sure drawmapscale method returns a list of objects that can be iterated over to remove them from the plot. * fillcontinents was returning just last Polygon instance. Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py === --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13 17:45:00 UTC (rev 6599) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-13 18:03:10 UTC (rev 6600) @@ -1586,7 +1586,8 @@ the SHPT* constants defined in the shapelib module, see http://shapelib.maptools.org/shp_api.html) and min and max are 4-element lists with the minimum and maximum values of the -vertices. +vertices. If ``drawbounds=True`` a +matplotlib.patches.LineCollection object is appended to the tuple. """ # open shapefile, read vertices for each object, convert # to map projection coordinates (only works for 2D shape types). @@ -1664,6 +1665,7 @@ ax.add_collection(lines) # set axes limits to fit map region. self.set_axes_limits(ax=ax) +info = info + (lines,) # save segments/polygons and shape attribute dicts as class attributes. self.__dict__[name]=shpsegs self.__dict__[name+'_info']=shpinfo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6601] trunk/toolkits/basemap/Changelog
Revision: 6601 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6601&view=rev Author: jswhit Date: 2008-12-13 19:01:00 + (Sat, 13 Dec 2008) Log Message: --- update entry Modified Paths: -- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog === --- trunk/toolkits/basemap/Changelog2008-12-13 18:03:10 UTC (rev 6600) +++ trunk/toolkits/basemap/Changelog2008-12-13 19:01:00 UTC (rev 6601) @@ -5,7 +5,8 @@ can be iterated over to remove them from the plot. * fillcontinents was returning just last Polygon instance. Now returns a list of all Polygon instances. - * bluemarble: pass kwargs to imshow, return Image instance. + * bluemarble/warpimage: pass kwargs to imshow, + return Image instance. version 0.99.2 (svn revision 6541) * fix drawlsmask method so that it works for cylindrical projections with limits outside (-180,180). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
