plotting.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:evaluation-toolkit 作者: lightfield-analysis 项目源码 文件源码
def add_colorbar(idx, cm, height, width, colorbar_bins=8, fontsize=None, img_width=1, scale=0.9):
    axis = plt.subplot(idx)
    plt.imshow(np.ones((height*scale, img_width)), alpha=0)

    # colorbar width must be given as a percentage of the img width,
    # both together should be equal to w/wscale
    width_factor = 100 * (width - img_width) / float(img_width)

    divider = make_axes_locatable(axis)
    cax = divider.append_axes("right", size=str(width_factor)+"%", pad=0.0)
    create_colorbar(cm, cax, colorbar_bins, fontsize)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号