-Inf in colormap — low in MATLAB, high in Python?
问题 I've ported some MATLAB code to Python, including a plotting utility that plots a colormap of some data in a 2D matrix (list). MATLAB and Python plotting utilities are pretty similar, so I am able to make them match quite closely visually, with little effort. The test matrix that I'm using here is: X = [ 1 0 3 ] [ 4 5 6 ] [ 7 8 9 ] MATLAB with test matrix X = [1 0 3; 4 5 6; 7 8 9]; figure(1); imagesc(X); colormap(hot); colorbar; Python with test matrix import numpy as np import matplotlib as