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

Function on_press

galleries/examples/event_handling/keypress_demo.py:22–28  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

20
21
22def on_press(event):
23 print('press', event.key)
24 sys.stdout.flush()
25 if event.key == 'x':
26 visible = xl.get_visible()
27 xl.set_visible(not visible)
28 fig.canvas.draw()
29
30
31# Fixing random state for reproducibility

Callers

nothing calls this directly

Calls 4

flushMethod · 0.80
get_visibleMethod · 0.45
set_visibleMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…