plotting.py 文件源码

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

项目:devito 作者: opesci 项目源码 文件源码
def plot_image(data, vmin=None, vmax=None, colorbar=True, cmap="gray"):
    """
    Plot image data, such as RTM images or FWI gradients.

    :param data: Image data to plot
    :param cmap: Choice of colormap, default is gray scale for images as a
    seismic convention
    """
    plot = plt.imshow(np.transpose(data),
                      vmin=vmin or 0.9 * np.min(data),
                      vmax=vmax or 1.1 * np.max(data),
                      cmap=cmap)

    # Create aligned colorbar on the right
    if colorbar:
        ax = plt.gca()
        divider = make_axes_locatable(ax)
        cax = divider.append_axes("right", size="5%", pad=0.05)
        plt.colorbar(plot, cax=cax)
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号