事件处理#

Matplotlib 支持具有 GUI 中性事件模型的 event handling ,因此您可以连接到 Matplotlib 事件,而无需了解 Matplotlib 最终将插入到什么用户界面中.这有两个优点:您编写的代码将更具可移植性,并且 Matplotlib 事件知道诸如数据坐标空间以及事件发生在哪个轴之类的事情,因此您不必处理低级转换细节即可从画布空间转到数据空间.还包括对象拾取示例.

关闭事件

Close event

鼠标移动和点击事件

Mouse move and click events

十字光标

Cross-hair cursor

数据浏览器

Data browser

Figure/Axes 进入和离开事件

Figure/Axes enter and leave events

交互函数

Interactive functions

滚动事件

Scroll event

按键事件

Keypress event

Lasso 演示

Lasso Demo

图例拾取

Legend picking

窥镜

Looking glass

路径编辑器

Path editor

Pick 事件演示

Pick event demo

Pick 事件演示 2

Pick event demo 2

多边形编辑器

Polygon editor

Pong

Pong

重采样数据

Resampling Data

定时器

Timers

Trifinder 事件演示

Trifinder Event Demo

Viewlims

Viewlims

缩放修改其他坐标轴

Zoom modifies other Axes