File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
example_cursor_scatter_experimental Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ def __init__(self, **kwargs):
90
90
91
91
self .lines = []
92
92
self .scatters = []
93
+ self .scatter_label = None
93
94
94
95
self .bind (size = self ._onSize )
95
96
@@ -314,7 +315,10 @@ def hover(self, event) -> None:
314
315
self .vertical_line .set_xdata (x )
315
316
316
317
#x y label
317
- self .text .set_text (f"x={ x } , y={ y } " )
318
+ if self .scatter_label and idx_best > len (good_line )- 1 :
319
+ self .text .set_text (f"pt{ self .scatter_label [good_index_scatter [idx_best ]]} x={ x } , y={ y } " )
320
+ else :
321
+ self .text .set_text (f"x={ x } , y={ y } " )
318
322
319
323
#blit method (always use because same visual effect as draw)
320
324
self .axes .draw_artist (self .axes .patch )
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ def on_start(self, *args):
47
47
mygraph = GraphGenerator ()
48
48
49
49
self .screen .figure_wgt .figure = mygraph .fig
50
+ self .screen .figure_wgt .scatter_label = mygraph .ptid
50
51
self .screen .figure_wgt .axes = mygraph .ax1
51
52
self .screen .figure_wgt .xmin = mygraph .xmin
52
53
self .screen .figure_wgt .xmax = mygraph .xmax
You can’t perform that action at this time.
0 commit comments