diff --git a/CHANGELOG b/CHANGELOG index 9e1c103..c83aca5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +0.7.2 + - fix: setting bad fit range lead to ValueError during plotting 0.7.1 - fix: wrong SI units assigend to fit results parameters - setup: bump afmformats from 0.9.0 to 0.10.0 diff --git a/pyjibe/fd/mpl_indent.py b/pyjibe/fd/mpl_indent.py index 8b944b0..3582414 100644 --- a/pyjibe/fd/mpl_indent.py +++ b/pyjibe/fd/mpl_indent.py @@ -85,9 +85,10 @@ def update(self, fdist, rescale_x=None, rescale_y=None): self.axis_res.set_ylabel("residuals [{}]".format(yunit)) self.axis_main.set_ylabel("{} [{}]".format(yaxis, yunit)) - if "fit" in fdist.data: + if "fit" in fdist.data and np.sum(fdist["fit range"]): self.plots["residuals"].set_visible(True) self.plots["fit"].set_visible(True) + self.plots["fit range"].set_visible(True) self.plots["fit"].set_data(fdist["tip position"]*xscale, fdist["fit"]*yscale) @@ -101,12 +102,14 @@ def update(self, fdist, rescale_x=None, rescale_y=None): xy[:, 0] = fitmax xy[2:4, 0] = fitmin self.plots["fit range"].set_xy(xy) + + self.update_plot(rescale_x=rescale_x, + rescale_y=rescale_y) else: self.plots["residuals"].set_visible(False) self.plots["fit"].set_visible(False) - - self.update_plot(rescale_x=rescale_x, - rescale_y=rescale_y) + self.plots["fit range"].set_visible(False) + self.canvas.draw() def update_plot(self, rescale_x=None, rescale_y=None): """Update plot data range"""