rectp2 = [.09, .050, .8, .15] rectp1 = [.09, .245, .8, .33] rectp0 = [.09, .620, .8, .36] axp2 = fig.add_axes(rectp2) axp1 = fig.add_axes(rectp1) axp0 = fig.add_axes(rectp0) # read data and plot gsac, opts = getDataOpts() # prs opts.ynorm = .95 saclist = gsac.saclist prs = sacprs(saclist, opts, axp0) # p1 opts.ynorm = 1.7 p1 = sacp1(saclist, opts, axp1) # p2 opts.reltime = 0 p2 = sacp2(saclist, opts, axp2) # set x limits axp0.set_xlim(625, 762) axp1.set_xlim(625, 762) axp2.set_xlim(-45, 65) # numbering axs = [axp0, axp1, axp2] labs = 'abc' for ax, lab in zip(axs, labs): tt = '(' + lab + ')' trans = transforms.blended_transform_factory(ax.transAxes, ax.transAxes) ax.text(-.05, 1, tt, transform=trans, va='center', ha='right', size=16)
opts.ccpara = ccpara return gsac, opts if __name__ == '__main__': gsac, opts = load() saclist = gsac.saclist xxlim = -20, 20 reltimes = [0, 3] npick = len(reltimes) axs = axes1(npick) twa = -10, 10 twb = getwin(gsac, opts, 't2') twins = [twa, twb] tts = ['Predicted', 'Measured'] for i in range(npick): opts.reltime = reltimes[i] ax = axs[i] sacp1(saclist, opts, ax) ax.set_xlim(xxlim) plotwin(ax, twins[i], opts.pppara) ax.set_title(tts[i]) labs = 'ab' for ax, lab in zip(axs, labs): tt = '(' + lab + ')' trans = transforms.blended_transform_factory(ax.transAxes, ax.transAxes) ax.text(-.05, 1, tt, transform=trans, va='center', ha='right', size=16) plt.savefig('egalignp1.pdf', format='pdf') plt.show()
gsac, opts = load() saclist = gsac.saclist xxlim = -20, 20 reltimes = [0, 3] npick = len(reltimes) axs = axes1(npick) twa = -10, 10 twb = getwin(gsac, opts, 't2') twins = [twa, twb] tts = ['Predicted', 'Measured'] for i in range(npick): opts.reltime = reltimes[i] ax = axs[i] sacp1(saclist, opts, ax) ax.set_xlim(xxlim) plotwin(ax, twins[i], opts.pppara) ax.set_title(tts[i]) labs = 'ab' for ax, lab in zip(axs, labs): tt = '(' + lab + ')' trans = transforms.blended_transform_factory(ax.transAxes, ax.transAxes) ax.text(-.05, 1, tt, transform=trans, va='center', ha='right', size=16) plt.savefig('egalignp1.pdf', format='pdf') plt.show()
#!/usr/bin/env python #------------------------------------------------ # Filename: sacp1.py # Author: Xiaoting Lou # Email: [email protected] # # Copyright (c) 2009-2012 Xiaoting Lou #------------------------------------------------ """ Python script fo SAC p1 style of plotting. :copyright: Xiaoting Lou :license: GNU General Public License, Version 3 (GPLv3) http://www.gnu.org/licenses/gpl.html """ from matplotlib.pyplot import show from pysmo.aimbat.plotphase import getDataOpts, getAxes, sacp1 gsac, opts = getDataOpts() axss = getAxes(opts) ssg = sacp1(gsac.saclist, opts, axss) show()
rectp2 = [.09, .050, .8, .15] rectp1 = [.09, .245, .8, .33] rectp0 = [.09, .620, .8, .36] axp2 = fig.add_axes(rectp2) axp1 = fig.add_axes(rectp1) axp0 = fig.add_axes(rectp0) # read data and plot gsac, opts = getDataOpts() # prs opts.ynorm = .95 saclist = gsac.saclist prs = sacprs(saclist, opts, axp0) # p1 opts.ynorm = 1.7 p1 = sacp1(saclist, opts, axp1) # p2 opts.reltime = 0 p2 = sacp2(saclist, opts, axp2) # set x limits axp0.set_xlim(625, 762) axp1.set_xlim(625, 762) axp2.set_xlim(-45, 65) # numbering axs = [axp0, axp1, axp2] labs = 'abc' for ax, lab in zip(axs, labs): tt = '(' + lab + ')' trans = transforms.blended_transform_factory(ax.transAxes, ax.transAxes) ax.text(-.05, 1, tt, transform=trans, va='center', ha='right', size=16) fig.savefig('egplot.pdf', format='pdf')