Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try:
Lstar[qual].extend(data[alpha]['Lstar'])
except TypeError:
Lstar[qual].append(data[alpha]['Lstar'].tolist())
print('Did [-%d,0,0] for all qualities' % rval)
#make plots
fstr = '%d1%d' % (len(rvals), rval-rvals[0]+1)
ax = fig.add_subplot(fstr)
ax.boxplot(Lstar)
#ax = plt.gca()
ax.set_title('LGM - Centred dipole [-%d, 0, 0]$_{SM}$; PA=%d$^{o}$' % (rval, alpha))
ax.set_ylabel('L* (LanlGeoMag)')
ax.set_xlabel('Quality Flag')
ax.set_xticklabels([str(n) for n in range(5)])
tb.savepickle('lgm_cdip_lstar%d_alpha%d.pkl' % (rval, alpha), {'Lstar': Lstar})
plt.ylim([rval-0.04, rval+0.04])
plt.savefig('lgm_cdip_verify%d.png' % alpha, dpi=300)
##fig.savefig('lgm_cdip_verify%d_zoom.png' % alpha, dpi=300)