使用以下代码:
import matplotlib.cm as cm
from matplotlib import colors
import matplotlib.pyplot as plt
colormap = cm.YlOrRd
norm = colors.LogNorm(vmin=100, vmax=10000)
sm = plt.cm.ScalarMappable(cmap=colormap, norm=norm)
sm.set_array([])
cb = plt.colorbar(sm, ticks = [1,10,100,1000,10000,100000])
plt.show()
我希望刻度是“ 100 1000 10000”,但我看到的是10的幂。我该如何解决?