Skip to content

Commit ceffb3f

Browse files
committed
Add alpha blending to wmsimage
Add alpha argument to wmsimage(), so the image downloaded from the WMS server blends with the basemap
1 parent 2a57d9c commit ceffb3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/mpl_toolkits/basemap/__init__.py

Lines changed: 3 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,7 @@ 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, between 0 (transparent) and 1 (opaque)
43224323
verbose if True, print WMS server info (default
43234324
False).
43244325
\**kwargs extra keyword arguments passed on to
@@ -4380,7 +4381,7 @@ def wmsimage(self,server,\
43804381
# return AxesImage instance.
43814382
# this works for png and jpeg.
43824383
return self.imshow(imread(io.BytesIO(img.read()),
4383-
format=format),origin='upper')
4384+
format=format),origin='upper',alpha=alpha)
43844385
# this works for png, but not jpeg
43854386
#return self.imshow(imread(urllib2.urlopen(img.url),format=format),origin='upper')
43864387

0 commit comments

Comments
 (0)