Skip to content
Snippets Groups Projects
Commit fa439689 authored by Kien Le's avatar Kien Le
Browse files

Merge branch 'bug-#63-plot_point_count_text_not_being_removed_between_zoom' into 'master'

Fix plots' point count texts not being removed between zoom

Closes #63

See merge request !91
parents c002cbd1 5d58c8c3
No related branches found
No related tags found
1 merge request!91Fix plots' point count texts not being removed between zoom
Pipeline #2380 passed with stage
in 2 minutes and 55 seconds
......@@ -475,8 +475,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
if not first_time:
# x, y
new_x_indexes = np.where((ax.x >= self.min_x) &
(ax.x <= self.max_x))
(ax.x <= self.max_x))[0]
# reset total of samples on the right
ax.sampleLbl.set_text(len(new_x_indexes))
......@@ -542,3 +541,10 @@ class PlottingWidget(QtWidgets.QScrollArea):
:param widgets: [PlottingWidgets,] - List of other plotting widgets
"""
self.peer_plotting_widgets = widgets
def remove_plot_num_points_text(self):
"""
Remove the texts showing the number of points in each plot.
"""
for ax in self.axes:
ax.texts.clear()
......@@ -144,3 +144,15 @@ class SOHWidget(plotting_widget.PlottingWidget):
else:
getattr(self.plotting, plot_functions[plot_type][1])(
c_data, chan_db_info, chan_id, c_data['ax'], None)
def set_lim(self, first_time=False):
"""
Remove all texts that show the numbers of points in the plots before
setting the limits of the plots.
:param first_time: whether this method was called on the initial
plotting
"""
if not first_time:
self.remove_plot_num_points_text()
super().set_lim()
......@@ -169,6 +169,9 @@ class WaveformWidget(plotting_widget.PlottingWidget):
:param first_time: flag that indicate whether set_lim is called the
fist time for a data set.
"""
if not first_time:
self.remove_plot_num_points_text()
self.data_processors = []
if not self.is_working:
self.is_working = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment