From 5b39eabe4265d399e5f180fa4995ed1bf87280e2 Mon Sep 17 00:00:00 2001
From: ldam <ldam@passcal.nmt.edu>
Date: Tue, 18 Jul 2023 11:25:29 -0600
Subject: [PATCH] adjust plotting_bot_pixel in get_heitht()

---
 .../plotting/plotting_widget/plotting_axes.py    | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py
index 508f96cd2..30e5abe46 100644
--- a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py
+++ b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py
@@ -352,17 +352,23 @@ class PlottingAxes:
                 )
             )
 
-    def get_height(self, ratio, bw_plots_distance=0.0015):
+    def get_height(self, ratio: float, bw_plots_distance: float = 0.0015,
+                   pixel_height: float = 19) -> float:
         """
         Calculate new plot's bottom position and return plot's height.
 
-        :param ratio: float - ratio of the plot height on the BASIC_HEIGHT
-        :param bw_plots_distance: float - distance between plots
-        :return plot_h: float - height of the plot
+        :param ratio: ratio of the plot height on the BASIC_HEIGHT
+        :param bw_plots_distance: distance between plots
+        :param pixel_height: height of plot in pixel (
+            for TPS/TPS legend, height of each day row)
+
+        :return plot_h: height of the plot
         """
         plot_h = constants.BASIC_HEIGHT * ratio  # ratio with figure height
         self.parent.plotting_bot -= plot_h + bw_plots_distance
-        self.parent.plotting_bot_pixel += 19 * ratio
+        bw_plots_distance_pixel = 3000 * bw_plots_distance
+        self.parent.plotting_bot_pixel += (pixel_height * ratio +
+                                           bw_plots_distance_pixel)
         return plot_h
 
     def add_ruler(self, color):
-- 
GitLab