Skip to content

Commit 0b40c8c

Browse files
committed
Improve range value display in BaseAnnotatedRangeSelection with detailed min/max formatting
1 parent 830a8c2 commit 0b40c8c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

plotpy/items/annotation.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,16 @@ def get_info(self) -> str:
712712
str: Formatted string with informations on current shape
713713
"""
714714
coord_str = "x" if isinstance(self.shape, XRangeSelection) else "y"
715-
center_val = self.x_to_str(self.get_tr_center())
716-
range_val = self.x_to_str(self.get_tr_range())
717-
half_range_val = self.x_to_str(self.get_tr_range() / 2)
715+
c, r = self.get_tr_center(), self.get_tr_range()
716+
center_val = self.x_to_str(c)
717+
range_val = self.x_to_str(r)
718+
lower_val = self.x_to_str(c - 0.5 * r)
719+
upper_val = self.x_to_str(c + 0.5 * r)
718720
return "<br>".join(
719721
[
720-
f"{coord_str} = {center_val} ± {half_range_val}",
722+
f"{coord_str}<sub>C</sub> = {center_val}",
723+
f"{coord_str}<sub>MIN</sub> = {lower_val}",
724+
f"{coord_str}<sub>MAX</sub> = {upper_val}",
721725
f"Δ{coord_str} = {range_val}",
722726
]
723727
)

0 commit comments

Comments
 (0)