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

for fixPoint=0, round to the decimal places that can show differences between max and min

parent f1db24c8
No related branches found
No related tags found
1 merge request!120fixing displayed extreme values for channels
Pipeline #2546 failed with stage
in 2 minutes and 40 seconds
......@@ -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
......
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