MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_pick

Function test_pick

lib/matplotlib/tests/test_backend_bases.py:146–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144
145
146def test_pick():
147 fig = plt.figure()
148 fig.text(.5, .5, "hello", ha="center", va="center", picker=True)
149 fig.canvas.draw()
150
151 picks = []
152 def handle_pick(event):
153 assert event.mouseevent.key == "a"
154 picks.append(event)
155 fig.canvas.mpl_connect("pick_event", handle_pick)
156
157 KeyEvent("key_press_event", fig.canvas, "a")._process()
158 MouseEvent("button_press_event", fig.canvas,
159 *fig.transFigure.transform((.5, .5)),
160 MouseButton.LEFT)._process()
161 KeyEvent("key_release_event", fig.canvas, "a")._process()
162 assert len(picks) == 1
163
164
165def test_interactive_zoom():

Callers

nothing calls this directly

Calls 8

KeyEventClass · 0.90
MouseEventClass · 0.90
figureMethod · 0.80
mpl_connectMethod · 0.80
_processMethod · 0.80
textMethod · 0.45
drawMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…