diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting.py b/sohstationviewer/view/plotting/plotting_widget/plotting.py index faa1f90b097b42a274860aecfc252e4e0ee5df18..d576b131be31f5dc00624fa68aaffe6db85923f3 100644 --- a/sohstationviewer/view/plotting/plotting_widget/plotting.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting.py @@ -174,18 +174,17 @@ class Plotting: ax.plot(points_list[1], len(points_list[1]) * [0.5], linestyle="", marker='s', markersize=2, zorder=constants.Z_ORDER['DOT'], color=clr[colors[1]], picker=True, pickradius=3) - x = points_list[0] + points_list[1] - x = sorted(x) + ax.set_ylim(-2, 2) self.plotting_axes.set_axes_info( ax, [len(points_list[0]), len(points_list[1])], sample_no_colors=[clr[colors[0]], clr[colors[1]]], sample_no_pos=[0.25, 0.75], chan_db_info=chan_db_info, linked_ax=linked_ax) - if linked_ax is None: - ax.x = x - else: - ax.linkedX = x + + ax.x0 = points_list[0] + ax.x1 = points_list[1] + ax.chan_db_info = chan_db_info return ax diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py index da53fd8fea8b450de097386e6fbbb483377cfb63..8a15edf521f9d0fb25470811bc3f7377318c30dd 100755 --- a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py @@ -557,7 +557,7 @@ class PlottingWidget(QtWidgets.QScrollArea): self.max_x)] # reset total of samples on the right - self.gap_bar.center_total_points_lbl.set_text(len(new_gaps)) + self.gap_bar.center_total_point_lbl.set_text(len(new_gaps)) for ax in self.axes: if hasattr(ax, 'x') and ax.x is None: @@ -590,18 +590,17 @@ class PlottingWidget(QtWidgets.QScrollArea): if tr_min_ys != []: new_min_y = min(tr_min_ys) new_max_y = max(tr_max_ys) - else: + ax.center_total_point_lbl.set_text(total_points) + elif hasattr(ax, 'x'): total_points = len(ax.x) if hasattr(ax, 'y') and len(ax.y) > 0: new_min_y = min(ax.y) new_max_y = max(ax.y) - try: - ax.center_total_points_lbl.set_text(total_points) - except AttributeError: + ax.center_total_point_lbl.set_text(total_points) + else: # for case of having top and bottom total points - # which is for RT130's SOH only, trust in total point - # calculated in set_axes_info - pass + ax.bottom_total_point_lbl.set_text(len(ax.x0)) + ax.top_total_point_lbl.set_text(len(ax.x1)) if new_min_y is not None: self.plotting_axes.set_axes_ylim(