需要帮助将色标添加到我的2个支持中

时间:2019-04-10 17:08:49

标签: python mapping figure colorbar

我试图在这些子图中添加一个小颜色条,但是我在使用正确的代码语法时遇到了麻烦。

fig, axs = plt.subplots(1, 2, sharex = True, sharey = True)
ax = axs[0]
ax.imshow(d_3070)
ax.set_title('3070 minus BG')

ax = axs[1]
ax.imshow(d_2904)
ax.set_title('2904 minus BG')

plt.colorbar(ax)

我认为plt.colorbar是实现此目的的正确代码,但是我得到的是空白栏,而不是显示地图颜色的东西。

0 个答案:

没有答案