From 03bdd92c21607736d6a4949df934304b0d29ba2f Mon Sep 17 00:00:00 2001 From: ldam <ldam@passcal.nmt.edu> Date: Thu, 24 Aug 2023 13:50:15 -0600 Subject: [PATCH] add docstring to explain top and bottom labels for data points --- .../view/plotting/plotting_widget/plotting.py | 2 ++ .../plotting/plotting_widget/plotting_axes.py | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting.py b/sohstationviewer/view/plotting/plotting_widget/plotting.py index 44389d328..74ebf7f5d 100644 --- a/sohstationviewer/view/plotting/plotting_widget/plotting.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting.py @@ -181,6 +181,8 @@ class Plotting: sample_no_pos=[0.25, 0.75], chan_db_info=chan_db_info, linked_ax=linked_ax) + # x_bottom, x_top are the times of data points to be displayed at + # bottom or top of the plot ax.x_bottom = np.array(points_list[0]) ax.x_top = np.array(points_list[1]) diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py index 070cb236d..cbe97d144 100644 --- a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py @@ -222,6 +222,10 @@ class PlottingAxes: # set samples' total on right side if len(sample_no_list) == 1: + # center_total_point_lbl: The label to display total number of data + # points for plots whose ax has attribute x_list. + # The plotTypes that use this label are linesDot, linesSRate, + # linesMassPos, dotForTime, multiColorDot ax.center_total_point_lbl = ax.text( 1.005, 0.5, sample_no_list[0], @@ -233,13 +237,12 @@ class PlottingAxes: size=self.parent.font_size ) else: - # Each zoom this infor is created again. - # Plots that have data separated in two to have text in top and - # bottom, sample rate= 1. These numbers completely depends - # on data created in trim_downsample_chan_with_spr_less_or_equal_1 - # and won't be changed in set_lim, then don't need to assign a - # variable for it. - # bottom + # bottom_total_point_lbl, top_total_point_lbl are label to diplay + # total number of data points which are splitted into top + # and bottom. The ax needs to include attributes x_bottom and x_top + # The plotTypes that use these labels are upDownDots (and linesDot + # with channel='GPS Lk/Unlk' which will have another MR to add + # x_bottom and x_top for this) ax.bottom_total_point_lbl = ax.text( 1.005, sample_no_pos[0], sample_no_list[0], -- GitLab