Skip to content
Snippets Groups Projects

when zooming, set_axes_ylim only perform when total_points > 1 to prevent the...

Merged Lan Dam requested to merge i125_improve_zoom_has_one_points into master
1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
@@ -586,12 +586,13 @@ class PlottingWidget(QtWidgets.QScrollArea):
@@ -586,12 +586,13 @@ class PlottingWidget(QtWidgets.QScrollArea):
if tr_min_ys != []:
if tr_min_ys != []:
new_min_y = min(tr_min_ys)
new_min_y = min(tr_min_ys)
new_max_y = max(tr_max_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)
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):
def draw(self):
"""
"""
Update drawing on the widget.
Update drawing on the widget.
Loading