I would like to plot the 2 output variables, say map1 and map2, as a function of 2 input variables, say x and y using colormaps. So as to do so, I want to represent map1 using a color scale while map2 would rely on a transparency scale. Yet, the alpha option cannot take an np.array as an argument and the following code is doomed to failure.
fig=plt.figure(num=None, figsize=(21,12), dpi=80, facecolor='w', edgecolor='k')
ax1=plt.subplot(211)
im = ax1.pcolor(map1, cmap='Spectral_r', alpha=map2)
fig.colorbar(im)
Would anybody see a way to do this? I don't want to use another overlapped color scale and really want map2 to be represented with a transparency function so as the visibility of a background grid for instance would tell the reader the amplitude of map2.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…