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
dtopotools_horiz_okada_and_1d.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录