How to set the alpha value for each element of a numpy array
===

I want to populate an array and then show it like an image. I want to set two parameters for each array element: a "color value" and a "transparency value".
I am using imshow from matplotlib, but I am open to other solutions.
I have tried with something like this, where ca_map is a square simetric array (i.e. A_ij = A_ji)
    
    ca_map = np.array(ca_map)
    
    palette = cm.jet
    palette.set_under('w', 1.0)
    
    plt.axis('off')
    plt.imshow(ca_map, cmap=palette, norm=colors.Normalize(vmin=0, clip=False), interpolation='sinc')
    plt.show()

Thanks in advance.