【发布时间】:2014-01-12 07:14:13
【问题描述】:
我有以下代码用于在 matplotlib 中制作表格。
fig = plt.figure(figsize=(15,8))
ax = fig.add_subplot(111, frameon=True, xticks = [], yticks = [])
tb = plt.table(cellText = cells[:30], rowLabels = range(30), colLabels = range(30), loc = 'center',cellColours = plt.cm.hot(normal(cells[:30])))
ax.add_table(tb)
plt.show()
plt 是一个 pyplot 对象
我想为我使用的颜色图添加一个颜色条。
我尝试做fig.colorbar(),但这给了我一个画布错误。
【问题讨论】:
标签: python matplotlib