dtopotools_horiz_okada_and_1d.py 文件源码

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

项目:finite_volume_seismic_model 作者: cjvogl 项目源码 文件源码
def plot_dZ_contours(x, y, dZ, axes=None, dZ_interval=0.5, verbose=False,
                               fig_kwargs={}):
    r"""For plotting seafloor deformation dZ"""
    import matplotlib.pyplot as plt

    dZ_max = max(dZ.max(), -dZ.min()) + dZ_interval
    clines1 = numpy.arange(dZ_interval, dZ_max, dZ_interval)
    clines = list(-numpy.flipud(clines1)) + list(clines1)

    # Create axes if needed
    if axes is None:
        fig = plt.figure(**fig_kwargs)
        axes = fig.add_subplot(111)

    if len(clines) > 0:
        if verbose:
            print "Plotting contour lines at: ",clines
        axes.contour(x, y, dZ, clines, colors='k')
    else:
        print "No contours to plot"

    return axes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号