ich hätte gerne das weiße meiner Colormap um den Wert Null. Ich habe schon mit vmin und vmax herumgespielt, schaffe es aber (noch) nicht den Wert -7 auf rot, Wert 0 auf weiß und Wert 1 auf blau zu setzen...
Ist das überhaupt möglich, ohne eine custom Colormap zu definieren ?
Code: Alles auswählen
import numpy as np
import matplotlib.pyplot as plt
# some data
x = np.array([[0,0,0,0,0],[0,1,1,1,0],[0,-4,-7,-4,0],[0,1,1,1,0],[0,0,0,0,0]])
fig = plt.figure()
ax = plt.imshow(x)
ax.set_cmap('seismic_r')
plt.colorbar(ax)
plt.show()