
Img2 = plt. # here it is progressive, but you can create whathever you want # create your alpha array and fill the colormap with them.
Then, you can fill the alpha values according to what you want to achieve (in your example, create an array from 0 to 0.8)īelow is an example using your code: from lors import colorConverter. Then initialize this colormap object: this will cause it to internally create an array called "_lut" which holds rgba values. Or create your own colormap as you did, if the colormap you want doesn't already exist. First, choose a matplotlib colormap object (in your case, for white and black, you can take the 'binary' colormap). Here is a description of what you can do:
This module.(colors): Colormap object generated from a list. RGB and RGBA are sequences of, respectively, 3 or 4 floats in the range 0-1. In your example, img3 = plt.imshow(zvals2, interpolation='nearest', cmap=cmap2, origin='lower', alpha=0.6) EDIT: A module for converting numbers or color arguments to RGB or RGBA.
You can set the alpha argument in your imshow command.