matplotlib.py 文件源码

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

项目:physt 作者: janpipek 项目源码 文件源码
def _add_colorbar(ax, cmap, cmap_data, norm):
    """Show a colorbar right of the plot.

    Parameters
    ----------
    ax : plt.Axes
    cmap : colors.Colormap
    cmap_data : array_like
    norm : colors.Normalize
    """
    fig = ax.get_figure()
    mappable = cm.ScalarMappable(cmap=cmap, norm=norm)
    mappable.set_array(cmap_data)   # TODO: Or what???
    fig.colorbar(mappable, ax=ax)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号