[Matplotlib-users] Heatmap Continent Transparency

joeyajames joeyajames at yahoo.com
Mon Feb 1 01:16:38 EST 2016

I need to make the land areas transparent in my heatmaps because I am
overlaying them on a Google map, as you can see here, 
http://pmc.ucsc.edu/~joeyajames/ <http://pmc.ucsc.edu/~joeyajames/>  
I tried m.fillcontinents(color='white', alpha=0.0), but that doesn't work.
Without the fillcontinents() statement the land is red, and changing the
alpha only controls how much red shows through the white. Somehow I think I
need to mask out the data points on the land so the heatmap doesn't make
them red. Any tips?

m = Basemap(llcrnrlon=MIN_LON, llcrnrlat=MIN_LAT, urcrnrlon=MAX_LON,
lons, lats = np.meshgrid(lons1,lats1)
nlats = 3*topoin.shape[0]
nlons = 3*topoin.shape[1]
lons = np.linspace(MIN_LON, MAX_LON, nlons)
lats = np.linspace(MIN_LAT, MAX_LAT, nlats)
lons, lats = np.meshgrid(lons, lats)
x, y = m(lons, lats)
topo = interp(topoin,lons1,lats1,lons,lats,order=1)

minval, maxval = get_range2(topo)

# m.fillcontinents(color='white') 		

fig.savefig(filename, bbox_inches='tight', transparent=True)

View this message in context: http://matplotlib.1069221.n5.nabble.com/Heatmap-Continent-Transparency-tp46707.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

More information about the Matplotlib-users mailing list