|
From: Logi R. <lo...@be...> - 2012-01-02 11:55:31
|
Eric Firing wrote: > > On Wed, Dec 28, 2011 at 1:11 AM, Jeff Whitaker <js...@fa...> wrote: >> >> On 12/27/11 12:07 PM, Logi Ragnarsson wrote: >> >>> Is it supposed to be possible to do a filled contour plot with alpha levels in the colour map? I'm plotting weather data on top of maps and would very much like to plot low levels of wind and precipitation as mostly transparent, with higher levels more opaque. >>> >> Logi: It looks like alpha transparency is controlled with the alpha keyword, so you can't specify different alphas for each contour level. You may have to call contourf multiple times, changing the alpha as needed for each set of contour levels. >> >> -Jeff > > It looks like this is something I can fix by modifying ListedColormap. It is discarding the alpha values, and I don't think there is any reason it needs to do so. > > Eric I feel that this would be a worth-while improvement to the library. In the mean-time, I have realized that the source is all there for me to read, and I can probably create my own patched version of ListedColormap. Actually, I've been interpolating colours to feed to contourf, but it would be much more sensible to use a LinearSegmentedColormap for this. Unfortunately it also discards alpha levels. Regards, Logi PS I was getting digests of the list, so I couldn't properly respond to Eric's mail, in case the headers look funny. |