[bugfix] fig._tight=True tried to be set on None type

This commit is contained in:
Marcel Paffrath 2017-09-18 11:23:52 +02:00
parent 365657064f
commit 330e15441e
2 changed files with 3 additions and 6 deletions

View File

@ -477,7 +477,6 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = 'k'
fig._tight = True
epickP, lpickP, Perror = earllatepicker(z_copy, nfacP, tsnrz,
mpickP, iplot, fig=fig,
linecolor=linecolor)
@ -513,7 +512,6 @@ def autopickstation(wfstream, pickparam, verbose=False,
linecolor = fig_dict['plot_style']['linecolor']['rgba_mpl']
else:
fig = None
fig._tight = True
FM = fmpicker(zdat, z_copy, fmpickwin, mpickP, iplot, fig, linecolor)
else:
FM = fmpicker(zdat, z_copy, fmpickwin, mpickP, iplot)
@ -727,7 +725,6 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = 'k'
fig._tight = True
refSpick = PragPicker(arhcf2, tsnrh, pickwinS, iplot, ausS,
tsmoothS, aicarhpick.getpick(), fig, linecolor)
mpickS = refSpick.getpick()
@ -743,7 +740,6 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = 'k'
fig._tight = True
epickS1, lpickS1, Serror1 = earllatepicker(h_copy, nfacS,
tsnrh,
mpickS, iplot,
@ -762,7 +758,6 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = ''
fig._tight = True
epickS2, lpickS2, Serror2 = earllatepicker(h_copy, nfacS,
tsnrh,
mpickS, iplot,

View File

@ -130,6 +130,7 @@ def earllatepicker(X, nfac, TSNR, Pick1, iplot=0, verbosity=1, fig=None, linecol
if fig == None or fig == 'None':
fig = plt.figure() # iplot)
plt_flag = 1
fig._tight = True
ax = fig.add_subplot(111)
ax.plot(t, x, color=linecolor, linewidth=0.7, label='Data')
ax.axvspan(t[inoise[0]], t[inoise[-1]], color='y', alpha=0.2, lw=0, label='Noise Window')
@ -323,6 +324,7 @@ def fmpicker(Xraw, Xfilt, pickwin, Pick, iplot=0, fig=None, linecolor='k'):
if fig == None or fig == 'None':
fig = plt.figure() # iplot)
plt_flag = 1
fig._tight = True
ax1 = fig.add_subplot(211)
ax1.plot(t, xraw, color=linecolor, linewidth=0.7)
ax1.plot([Pick, Pick], [max(xraw), -max(xraw)], 'b', linewidth=2, label='Pick')
@ -794,8 +796,8 @@ def checksignallength(X, pick, TSNR, minsiglength, nfac, minpercent, iplot=0, fi
if fig == None or fig == 'None':
fig = plt.figure() # iplot)
plt_flag = 1
ax = fig.add_subplot(111)
fig._tight = True
ax = fig.add_subplot(111)
ax.plot(t, rms, color=linecolor, linewidth=0.7, label='RMS Data')
ax.axvspan(t[inoise[0]], t[inoise[-1]], color='y', alpha=0.2, lw=0, label='Noise Window')
ax.axvspan(t[isignal[0]], t[isignal[-1]], color='b', alpha=0.2, lw=0, label='Signal Window')