@@ -5753,9 +5753,9 @@ def statsSummary(self):
5753
5753
else:
5754
5754
start = 0
5755
5755
5756
- # position the stats summary relative to the right hand edge of the graph
5757
- # droptext_width,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc )
5758
- _,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5756
+ # position the stats summary relative to the right hand edge of the graph
5757
+ drop_label = QApplication.translate("Scope Annotation","DROP {0}", None).replace("{0}","[0-9:]*" )
5758
+ _,_,droptext_end = self.droptextBounds(drop_label, start,statsheight,ls,prop,fc)
5759
5759
stats_textbox_bounds = self.statstextboxBounds(self.ax.get_xlim()[1]+border,statsheight,statstr,ls,prop,fc)
5760
5760
stats_textbox_width = stats_textbox_bounds[2]
5761
5761
stats_textbox_height = stats_textbox_bounds[3]
@@ -5769,8 +5769,7 @@ def statsSummary(self):
5769
5769
prev_stats_textbox_width = 0
5770
5770
#set the maximum number of iterations
5771
5771
for _ in range(2, 20):
5772
- # droptext_width,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5773
- _,_,droptext_end = self.droptextBounds(start,statsheight,ls,prop,fc)
5772
+ _,_,droptext_end = self.droptextBounds(drop_label,start,statsheight,ls,prop,fc)
5774
5773
stats_textbox_bounds = self.statstextboxBounds(self.ax.get_xlim()[1]+border,statsheight,statstr,ls,prop,fc)
5775
5774
stats_textbox_width = stats_textbox_bounds[2]
5776
5775
stats_textbox_height = stats_textbox_bounds[3]
@@ -5810,11 +5809,14 @@ def statstextboxBounds(self,x_pos,y_pos,textstr,ls,prop,fc):
5810
5809
return bbox.bounds
5811
5810
5812
5811
5813
- def droptextBounds(self,x_pos,y_pos,ls,prop,fc):
5814
- import re
5812
+ def droptextBounds(self,drop_label,x_pos,y_pos,ls,prop,fc):
5813
+ import re
5814
+ droptext_width = 0
5815
+ droptextstart = 0
5816
+ droptext_end = 0
5815
5817
for child in self.ax.get_children():
5816
5818
if isinstance(child, mpl.text.Annotation):
5817
- droptext = re.search(r'.*\((.*?),.*(DROP [0-9:]*)' ,str(child))
5819
+ droptext = re.search(r'.*\((.*?),.*({0})'.format(drop_label) ,str(child))
5818
5820
if droptext:
5819
5821
droptextstart = int(float(droptext.group(1))) - x_pos
5820
5822
droptext_width = self.statstextboxBounds(x_pos,y_pos,droptext.group(2),ls,prop,fc)[2]
0 commit comments