On Thu, Sep 30, 2010 at 4:59 PM, Nicolas Bigaouette <firstname.lastname@example.org> wrote:
I'm plotting some data with imshow(). On the screen it looks good, but when printed (it's part of a paper) it's hard to see because it all looks blue or black.
I'm attaching an example.
What I would like to do it have a colormap which is transparent for lower values of data and opaque for high values, so the blue on the figure would appear white/transparent.
Is it possible? How to achieve this? alpha options seems to accept only a float for a uniform transparency.
Correct, most plotting functions in mpl assume a scalar alpha channel, but the backend of mpl does not have this restriction.
The colormap object itself is not restricted to a single value for the alpha channel. I would imagine, although I have not tried this myself, that it would be possible to modify the colormap object's alpha values in the self._lut rgba array. Note that self._lut for a Colormap object is not created right away, only when it needs to make a color from a value.
I don't know if that helps at all, but good luck!