diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py index 940110dc3391f55ec682ff855975c427a9e40d01..8f604e53061001de2b9bcbbbb83564bddae8f73c 100644 --- a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py @@ -278,9 +278,9 @@ class PlottingAxes: ax.unit_bw = get_unit_bitweight( chan_db_info, self.main_window.bit_weight_opt ) - self.set_axes_ylim(ax, min_y, max_y) + self.set_axes_ylim(ax, min_y, max_y, chan_db_info) - def set_axes_ylim(self, ax, min_y, max_y): + def set_axes_ylim(self, ax, org_min_y, org_max_y, chan_db_info): """ Limit y range in min_y, max_y. Set y tick labels at min_y, max_y @@ -288,8 +288,16 @@ class PlottingAxes: :param min_y: float - minimum of y values :param max_y: float - maximum of y values """ - min_y = round(min_y, 2) - max_y = round(max_y, 2) + min_y = round(org_min_y, 7) + max_y = round(org_max_y, 7) + if chan_db_info['fixPoint'] == 0 and org_max_y > org_min_y: + # if fixPoint=0, the format uses the save value created + # => try to round to to the point that user can see the differences + for dec in range(2, 8, 1): + min_y = round(org_min_y, dec) + max_y = round(org_max_y, dec) + if max_y > min_y: + break if max_y > min_y: # There are different values for y => show yticks for min, max # separately