Skip to content
Snippets Groups Projects
Commit 6b5067b1 authored by Lan Dam's avatar Lan Dam
Browse files

set_axis_info: remove clear labels at the beginning because with lim for...

set_axis_info: remove clear labels at the beginning because with lim for zooming, we don't recreate axis for each zoom; add labels for total of data point as attribute for ax to do set_text when there are changes for the total
parent 5653b4d7
No related branches found
No related tags found
3 merge requests!149Fix bug happen when zooming in overlap section,!148fix zooming, order, y for the combination of 2 channels GPS_lk_Unlk and GPS_clock_power,!145Change to use matplotlib's lim for zooming
...@@ -184,13 +184,6 @@ class PlottingAxes: ...@@ -184,13 +184,6 @@ class PlottingAxes:
axes, label of channel will be displayed with sub title's axes, label of channel will be displayed with sub title's
format - under main title. format - under main title.
""" """
if linked_ax is None:
# clear all texts before recreated.
# But not clear when this is a linked_ax because texts are already
# cleared with ax, if clear with linked_ax all info of ax won't be
# displayed
ax.texts.clear()
if label is None: if label is None:
label = chan_db_info['label'] label = chan_db_info['label']
...@@ -229,7 +222,7 @@ class PlottingAxes: ...@@ -229,7 +222,7 @@ class PlottingAxes:
# set samples' total on right side # set samples' total on right side
if len(sample_no_list) == 1: if len(sample_no_list) == 1:
ax.sampleLbl = ax.text( ax.center_total_points_lbl = ax.text(
1.005, 0.5, 1.005, 0.5,
sample_no_list[0], sample_no_list[0],
horizontalalignment='left', horizontalalignment='left',
...@@ -247,7 +240,7 @@ class PlottingAxes: ...@@ -247,7 +240,7 @@ class PlottingAxes:
# and won't be changed in set_lim, then don't need to assign a # and won't be changed in set_lim, then don't need to assign a
# variable for it. # variable for it.
# bottom # bottom
ax.text( ax.bottom_total_points_lbl = ax.text(
1.005, sample_no_pos[0], 1.005, sample_no_pos[0],
sample_no_list[0], sample_no_list[0],
horizontalalignment='left', horizontalalignment='left',
...@@ -258,7 +251,7 @@ class PlottingAxes: ...@@ -258,7 +251,7 @@ class PlottingAxes:
size=self.parent.font_size size=self.parent.font_size
) )
# top # top
ax.text( ax.top_total_points_lbl = ax.text(
1.005, sample_no_pos[1], 1.005, sample_no_pos[1],
sample_no_list[1], sample_no_list[1],
horizontalalignment='left', horizontalalignment='left',
......
...@@ -557,7 +557,7 @@ class PlottingWidget(QtWidgets.QScrollArea): ...@@ -557,7 +557,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
self.max_x)] self.max_x)]
# reset total of samples on the right # reset total of samples on the right
self.gap_bar.sampleLbl.set_text(len(new_gaps)) self.gap_bar.center_total_points_lbl.set_text(len(new_gaps))
for ax in self.axes: for ax in self.axes:
if hasattr(ax, 'x') and ax.x is None: if hasattr(ax, 'x') and ax.x is None:
...@@ -596,7 +596,7 @@ class PlottingWidget(QtWidgets.QScrollArea): ...@@ -596,7 +596,7 @@ class PlottingWidget(QtWidgets.QScrollArea):
new_min_y = min(ax.y) new_min_y = min(ax.y)
new_max_y = max(ax.y) new_max_y = max(ax.y)
try: try:
ax.sampleLbl.set_text(total_points) ax.center_total_points_lbl.set_text(total_points)
except AttributeError: except AttributeError:
# for case of having top and bottom total points # for case of having top and bottom total points
# which is for RT130's SOH only, trust in total point # which is for RT130's SOH only, trust in total point
......
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