It's as simple as cm.hot(0.3)
, which returns (0.82400814813704837, 0.0, 0.0, 1.0)
.
A full working program could read
import matplotlib.cm as cm
print(cm.hot(0.3))
If you also want to have the normalizer, use
import matplotlib as mpl
import matplotlib.cm as cm
norm = mpl.colors.Normalize(vmin=-20, vmax=10)
cmap = cm.hot
x = 0.3
m = cm.ScalarMappable(norm=norm, cmap=cmap)
print(m.to_rgba(x))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…