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

Function on_press

galleries/examples/event_handling/zoom_window.py:45–51  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

43
44
45def on_press(event):
46 if event.button != 1:
47 return
48 x, y = event.xdata, event.ydata
49 axzoom.set_xlim(x - 0.1, x + 0.1)
50 axzoom.set_ylim(y - 0.1, y + 0.1)
51 figzoom.canvas.draw()
52
53figsrc.canvas.mpl_connect('button_press_event', on_press)
54plt.show()

Callers

nothing calls this directly

Calls 3

set_xlimMethod · 0.45
set_ylimMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…