Friday, 15 May 2015

python - matplotlib imshow force colorrange -



python - matplotlib imshow force colorrange -

plotting matrix can contain values 0 - 100. however, there must not 100 max can 75 or something. want prepare color range 0 - 100 when there's no 100 in data, max value still same color value in matrix max = 100.

i tried

cax = ax.imshow(matrix,interpolation='nearest', cmap=cm.coolwarm) fig.colorbar(cax, ticks=[0, 100])

but no success?

try:

cax = ax.imshow(matrix, interpolation='nearest', cmap=cm.coolwarm, vmin=0, vmax=100)

python matplotlib

No comments:

Post a Comment