From b5d94eed61c3691dafffffecd89e7ae279d59d61 Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Wed, 8 Jun 2016 15:00:47 +0200 Subject: [PATCH] [closes #195] implementation of comparison within GUI ready for testing --- pylot/core/util/widgets.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index d31132cf..1b8631a4 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -197,15 +197,22 @@ class ComparisonDialog(QDialog): def plotcomparison(self): _axes = self.canvas.figure.add_subplot(111) + _axes.cla() station = self.plotprops['station'] phase = self.plotprops['phase'] pdf = self.data.comparison[station][phase] - x, y = pdf.axis, pdf.data + x, y, std, exp = pdf.axis, pdf.data, pdf.standard_deviation(), \ + pdf.expectation() _axes.plot(x, y) _axes.set_title(phase) _axes.set_ylabel('propability density (qual.)') _axes.set_xlabel('time difference [s]') - _anno = _axes.annotate(station, xy=(.05, .5), xycoords='axes fraction') + annotation = "{phase} difference on {station}\n" \ + "expectation: {exp}\n" \ + "std: {std}".format(station=station, phase=phase, + std=std, exp=exp) + _anno = _axes.annotate(annotation, xy=(.05, .5), xycoords='axes ' + 'fraction') bbox_props = dict(boxstyle='round', facecolor='lightgrey', alpha=.7) _anno.set_bbox(bbox_props) self.canvas.draw()