In plotcomparison: Better readable legends now.

This commit is contained in:
Ludger Küperkoch 2017-02-23 15:43:55 +01:00
parent b4c463b16f
commit 8ffa37eea6

View File

@ -241,10 +241,10 @@ class ComparisonDialog(QDialog):
x, y, std, exp = pdf.axis, pdf.data, pdf.standard_deviation(), \ x, y, std, exp = pdf.axis, pdf.data, pdf.standard_deviation(), \
pdf.expectation() pdf.expectation()
annotation = "{phase} difference on {station}\n" \ annotation = "%s difference on %s\n" \
"expectation: {exp} s\n" \ "expectation: %7.4f s\n" \
"std: {std} s".format(station=station, phase=phase, "std: %7.4f s" % (phase, station,
std=std, exp=exp) exp, std)
bbox_props = dict(boxstyle='round', facecolor='lightgrey', alpha=.7) bbox_props = dict(boxstyle='round', facecolor='lightgrey', alpha=.7)
plot_pdf(_axes, x, y, annotation, bbox_props, 'time difference [s]', plot_pdf(_axes, x, y, annotation, bbox_props, 'time difference [s]',
@ -252,7 +252,6 @@ class ComparisonDialog(QDialog):
pdf_a = copy.deepcopy(self.data.get('auto')[station][phase]) pdf_a = copy.deepcopy(self.data.get('auto')[station][phase])
pdf_m = copy.deepcopy(self.data.get('manu')[station][phase]) pdf_m = copy.deepcopy(self.data.get('manu')[station][phase])
xauto, yauto, stdauto, expauto, alim = pdf_a.axis, pdf_a.data(), \ xauto, yauto, stdauto, expauto, alim = pdf_a.axis, pdf_a.data(), \
pdf_a.standard_deviation(), \ pdf_a.standard_deviation(), \
@ -266,21 +265,19 @@ class ComparisonDialog(QDialog):
lims = clims(alim, mlim) lims = clims(alim, mlim)
# relative x axis # relative x axis
x0 = lims[0] x0 = lims[0]
xmanu -= x0 xmanu -= x0
xauto -= x0 xauto -= x0
lims = [lim - x0 for lim in lims] lims = [lim - x0 for lim in lims]
x0 = UTCDateTime(x0) x0 = UTCDateTime(x0)
# set annotation text # set annotation text
mannotation = "probability density of manual pick\n" \ mannotation = "probability density of manual pick\n" \
"expectation: {exp} s\n" \ "expectation: %7.4f s\n" \
"std: {std} s".format(std=stdmanu, "std: %7.4f s" % (expmanu-x0.timestamp, stdmanu)
exp=expmanu-x0.timestamp)
aannotation = "probability density of automatic pick\n" \ aannotation = "probability density of automatic pick\n" \
"expectation: {exp} s\n" \ "expectation: %7.4f s\n" \
"std: {std} s".format(std=stdauto, "std: %7.4f s" % (expauto-x0.timestamp, stdauto)
exp=expauto-x0.timestamp)
_ax1 = plot_pdf(_ax1, xmanu, ymanu, mannotation, _ax1 = plot_pdf(_ax1, xmanu, ymanu, mannotation,
bbox_props=bbox_props, xlabel='seconds since ' bbox_props=bbox_props, xlabel='seconds since '