放置颜色栏

放置颜色栏,第1张

放置颜色

更好地控制颜色栏位置的最佳方法是为其提供自己的轴。像这样:

# What I imagine your plotting looks like so farfig = plt.figure()ax1 = fig.add_subplot(111)ax1.plot(your_data)# Now adding the colorbarcbaxes = fig.add_axes([0.8, 0.1, 0.03, 0.8]) cb = plt.colorbar(ax1, cax = cbaxes)

add_axes的方括号中的数字表示[left,bottom,width,height],其中坐标只是绘图区域从0到1的分数。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5673700.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-17
下一篇2022-12-16

发表评论

登录后才能评论

评论列表(0条)

    保存