I did find a solution using a dummy case (and AI) Please see below for an example with five points (grid cells) to be plotted with pcolormesh. I missed the following:
from matplotlib.colors import ListedColormap, BoundaryNorm
...
bounds = np.arange(0.5, 6.5, 1) # Boundaries between colors
norm = BoundaryNorm(bounds, cmap.N)
...
c = ax.pcolormesh(lon, lat, data, cmap=cmap, norm=norm, shading='auto')
It is necessary to define the bounds and norm.