Skip to content

Commit faa1598

Browse files
committed
Merge pull request #301 from pablo-benito/wms-with-alpha
Add alpha blending to wmsimage
2 parents 2a57d9c + 026fe17 commit faa1598

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/mpl_toolkits/basemap/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4295,7 +4295,7 @@ def arcgisimage(self,server='http://server.arcgisonline.com/ArcGIS',\
42954295

42964296
def wmsimage(self,server,\
42974297
xpixels=400,ypixels=None,\
4298-
format='png',verbose=False,**kwargs):
4298+
format='png',alpha=None,verbose=False,**kwargs):
42994299
"""
43004300
Retrieve an image using from a WMS server using the
43014301
Open Geospatial Consortium (OGC) standard interface
@@ -4319,6 +4319,8 @@ def wmsimage(self,server,\
43194319
from xpixels and the aspect ratio of the
43204320
map projection region.
43214321
format desired image format (default 'png')
4322+
alpha The alpha blending value,
4323+
between 0 (transparent) and 1 (opaque) (default None)
43224324
verbose if True, print WMS server info (default
43234325
False).
43244326
\**kwargs extra keyword arguments passed on to
@@ -4380,7 +4382,7 @@ def wmsimage(self,server,\
43804382
# return AxesImage instance.
43814383
# this works for png and jpeg.
43824384
return self.imshow(imread(io.BytesIO(img.read()),
4383-
format=format),origin='upper')
4385+
format=format),origin='upper',alpha=alpha)
43844386
# this works for png, but not jpeg
43854387
#return self.imshow(imread(urllib2.urlopen(img.url),format=format),origin='upper')
43864388

0 commit comments

Comments
 (0)