pythonmatplotlibcolormapimshowcolor-mapping

Matplotlib imshow is ignoring cmap, vmin, vmax for ax.imshow subplots


I am trying to make subplots of small images of data and I am finding it completely impossible to adjust the cmap/vmin/vmax for any of these images. No matter what I can't figure out how to change the colour map and the limits, I don't have any idea what I'm doing wrong.

Image of code

Image of incorrect plot

Cheers!!


Solution

  • You are using the colorbar in a funny way. Try to do something like:

    im = axarr[0,0].imshow(...) 
    

    followed by:

    colorbar(im)
    

    What it does, is to take the created image and build the colorbar on top of it.