I'm looking to plot a matplotlib colormesh on top of another colormesh. The bottom plot is simply grayscale.
The one which sits on top should however draw a transparent square when the value of the passed array is 0, and a different color for each other number in the passed array. These are 2d numpy arrays.
Currently I have:
plt.pcolormesh(array1, vmin = -32, vmax = 32, cmap = plt.cm.binary)
plt.pcolormesh(array2, cmap = plt.cm.spectral)
Obviously this doesn't produce what I'm looking for, and I assume the way to do this is to generate my own colormap, I've read this guide: http://wiki.scipy.org/Cookbook/Matplotlib/ColormapTransformations but this doesn't seem to address transparency, nor how to make specific values map to specific colors.
As a short example of what I'd like, an array:
[[0, 1]
[2, 3]]
Should produce a grid looking like:
[[transparent, red
[green, yellow]]
How do I go about doing this? Merging the arrays together isn't an option, as the bottom dataset is a height map, and the values of this will likely always span the values of the second array (these are agent IDs).