Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

matplotlib colormap transparent white to black

c_white = matplotlib.colors.colorConverter.to_rgba('white',alpha = 0)
            c_black= matplotlib.colors.colorConverter.to_rgba('black',alpha = 1)
            cmap_rb = matplotlib.colors.LinearSegmentedColormap.from_list('rb_cmap',[c_white,c_black],512)
            
            
            pl = plt.pcolor(mp1,cmap=cmap_rb)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #matplotlib #colormap #transparent #white #black
ADD COMMENT
Topic
Name
7+7 =