I want to build multiple RGB images on one axis set using matplotlib. At first I tried using imshow for this, but it doesn't seem to be processing two images on the same set of axes with different extents (when I draw the second, it disappears first). I think the answer here is to use pcolormesh, as in How to build an irregular spaced RGB image using python and a base map?
However, this does not work for me - the color coming from the displayed one (i.e. the data array that I pass to pcolormesh and the specified cmap) overrides the color of the face that I specify. The edges of the mesh have the correct color, but not the edges.
Does anyone know how to directly set the complexion? Ideally, I would use pcolormesh, which takes an n * m * 3 array as an alternative to n * m, just like imshow ...
Minimal example of how I would like to work: import numpy as np import matplotlib.pyplot as plt
#make some sample data x, y = np.meshgrid(np.linspace(0,255,1),np.linspace(0,255,1)) r, g = np.meshgrid(np.linspace(0,255,100),np.linspace(0,255,120)) b=255-r
The problem is that the call to plt.pcolormesh fails,
numRows, numCols = C.shape ValueError: too many values to unpack
I guess this is because it needs a 2D array, not a three-dimensional array with a last size of 3 long.