diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py index 69956159bf6505d7a947070d41ce3fe92d0646c5..61571322be7050afbc0eec69e5fb2baef9ab6f4f 100755 --- a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py @@ -606,12 +606,13 @@ class PlottingWidget(QtWidgets.QScrollArea): if tr_min_ys != []: new_min_y = min(tr_min_ys) new_max_y = max(tr_max_ys) + # in case total_points == 1, y lim shouldn't be set + # again or the plot would be collapsed to one line + if total_points > 1: + self.plotting_axes.set_axes_ylim( + ax, new_min_y, new_max_y) ax.center_total_point_lbl.set_text(total_points) - if new_min_y is not None: - self.plotting_axes.set_axes_ylim( - ax, new_min_y, new_max_y, ax.chan_db_info) - def draw(self): """ Update drawing on the widget.