Skip to content

Commit ef43424

Browse files
authored
Merge pull request #10656 from anntzer/eventhandlingdoc
Minor fixes to event handling docs.
2 parents e54939a + c3c10fa commit ef43424

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

doc/users/event_handling.rst

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Event handling and picking
55
**************************
66

7-
matplotlib works with a number of user interface toolkits (wxpython,
7+
Matplotlib works with a number of user interface toolkits (wxpython,
88
tkinter, qt4, gtk, and macosx) and in order to support features like
99
interactive panning and zooming of figures, it is helpful to the
1010
developers to have an API for interacting with the figure via key
@@ -47,14 +47,16 @@ disconnect the callback, just call::
4747
fig.canvas.mpl_disconnect(cid)
4848

4949
.. note::
50-
The canvas retains only weak references to the callbacks. Therefore
51-
if a callback is a method of a class instance, you need to retain
52-
a reference to that instance. Otherwise the instance will be
53-
garbage-collected and the callback will vanish.
50+
The canvas retains only weak references to instance methods used as
51+
callbacks. Therefore, you need to retain a reference to instances owning
52+
such methods. Otherwise the instance will be garbage-collected and the
53+
callback will vanish.
54+
55+
This does not affect free functions used as callbacks.
5456

5557

5658
Here are the events that you can connect to, the class instances that
57-
are sent back to you when the event occurs, and the event descriptions
59+
are sent back to you when the event occurs, and the event descriptions:
5860

5961

6062
======================= =============================================================================================

examples/event_handling/README.txt

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
.. _event_handling_examples:
22

3-
Event Handling
3+
Event handling
44
==============
55

6-
Matplotlib supports event handling with a GUI neutral event model, so
7-
you can connect to Matplotlib events without knowledge of what user
8-
interface Matplotlib will ultimately be plugged in to. This has two
9-
advantages: the code you write will be more portable, and Matplotlib
10-
events are aware of things like data coordinate space and which axes
11-
the event occurs in so you don't have to mess with low level
12-
transformation details to go from canvas space to data space. Object
13-
picking examples are also included.
6+
Matplotlib supports :doc:`event handling</users/event_handling>` with a GUI
7+
neutral event model, so you can connect to Matplotlib events without knowledge
8+
of what user interface Matplotlib will ultimately be plugged in to. This has
9+
two advantages: the code you write will be more portable, and Matplotlib events
10+
are aware of things like data coordinate space and which axes the event occurs
11+
in so you don't have to mess with low level transformation details to go from
12+
canvas space to data space. Object picking examples are also included.

0 commit comments

Comments
 (0)