From 1fa729b9cbd5456e6daecb666d7980681cc510b1 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 30 Sep 2021 11:06:43 +0100 Subject: [PATCH] Auto range in Corr.show adjusted --- pyerrors/correlators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 4e3a98bb..36762eea 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -299,9 +299,9 @@ class Corr: if logscale: ax1.set_yscale('log') else: - # we generate ylim instead of using autoscaling. - y_min=min([(x[0].value - x[0].dvalue) for x in self.content[x_range[0]:x_range[1]] if(not x is None)]) - y_max=max([(x[0].value + x[0].dvalue) for x in self.content[x_range[0]:x_range[1]] if(not x is None)]) + # we generate ylim instead of using autoscaling. + y_min=min([(x[0].value - x[0].dvalue) for x in self.content[x_range[0]:x_range[1]] if (x is not None) and x[0].dvalue < 2 * np.abs(x[0].value)]) + y_max=max([(x[0].value + x[0].dvalue) for x in self.content[x_range[0]:x_range[1]] if (x is not None) and x[0].dvalue < 2 * np.abs(x[0].value)]) ax1.set_ylim([y_min - 0.1 * (y_max - y_min), y_max + 0.1 * (y_max - y_min)]) if comp: @@ -331,7 +331,7 @@ class Corr: handles, labels = ax1.get_legend_handles_labels() if labels: legend = ax1.legend() - plt.show() + plt.draw() if save: if isinstance(save, str):