diff --git a/pylot/core/util/pdf.py b/pylot/core/util/pdf.py index f199e52f..2882dec4 100644 --- a/pylot/core/util/pdf.py +++ b/pylot/core/util/pdf.py @@ -311,6 +311,12 @@ class ProbabilityDensityFunction(object): plt.title(title_str) plt.show() + def limits(self): + l1 = self.x0 + r1 = l1 + self.incr * self.npts + + return l1, r1 + def commonlimits(self, incr, other, max_npts=1e5): ''' Takes an increment incr and two left and two right limits and returns @@ -330,10 +336,8 @@ class ProbabilityDensityFunction(object): # >>> manu.commonlimits(0.01, auto) # ( - l1 = self.x0 - r1 = l1 + self.incr * self.npts - l2 = other.x0 - r2 = l2 + other.incr * other.npts + l1, r1 = self.limits() + l2, r2 = other.limits() if l1 < l2: x0 = l1 diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index a9ddecfa..2b0dcaee 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -243,7 +243,8 @@ class ComparisonDialog(QDialog): pdf_m.standard_deviation(), \ pdf_m.expectation() - _ax1.plot(xauto, yauto) + _ax1.plot(xmanu, ymanu) + _ax1.set_xlim(pdf_m.limits()) mannotation = "probability density for manual pick\n" \ "expectation: {exp}\n" \ "std: {std}".format(std=stdmanu, exp=expmanu) @@ -252,8 +253,9 @@ class ComparisonDialog(QDialog): bbox_props = dict(boxstyle='round', facecolor='lightgrey', alpha=.7) _anno.set_bbox(bbox_props) - - _ax2.plot(xmanu, ymanu) + _ax2.plot(xauto, yauto) + _ax2.set_xlim(pdf_a.limits()) + _ax2.set_ylabel('time [s]') aannotation = "probability density for automatic pick\n" \ "expectation: {exp}\n" \ "std: {std}".format(std=stdauto, exp=expauto)