【发布时间】:2011-02-02 02:49:56
【问题描述】:
我想在 matplotlib imshow subplot 旁边显示一个表示图像原始值的颜色条,该子图显示该图像,标准化。
我已经能够像这样成功地绘制图像和颜色条,但是颜色条的最小值和最大值表示标准化 (0,1) 图像而不是原始 (0,99) 图像。
f = plt.figure()
# create toy image
im = np.ones((100,100))
for x in range(100):
im[x] = x
# create imshow subplot
ax = f.add_subplot(111)
result = ax.imshow(im / im.max())
# Create the colorbar
axc, kw = matplotlib.colorbar.make_axes(ax)
cb = matplotlib.colorbar.Colorbar(axc, result)
# Set the colorbar
result.colorbar = cb
如果有人更精通 colorbar API,我很乐意听取您的意见。
谢谢! 亚当
【问题讨论】:
标签: python matplotlib