Skip to content

Commit 61a194b

Browse files
committed
DOC: address comments
1 parent 7019c50 commit 61a194b

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

doc/users/interactive_guide.rst

+14-12
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ a figure to inspect your data, however there is also a full mouse and
1010
keyboard event handling system to enable building sophisticated interactive
1111
graphs.
1212

13-
This page is meant to be a rapid introduction to the relevant details of
14-
integrating the matplotlib with a GUI event loop.
13+
This page is meant to be a rapid introduction to the relevant details
14+
of integrating the matplotlib with a GUI event loop. For further
15+
details see `Interactive Applications using Matplotlib
16+
<http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843>`__.
1517

1618

1719
The GUI event loop
@@ -35,34 +37,34 @@ The python capi provides a hook, `PyOS_InputHook`, to register a
3537
function to be run "The function will be called when Python's
3638
interpreter prompt is about to become idle and wait for user input
3739
from the terminal.". This hook can be used to integrate a second
38-
event loop with the python repl. Such a hooks are usually included
39-
with the python bindings for GUI toolkits and may be registered on
40-
import. IPython also includes hooks for all of the GUI frameworks
41-
supported by matplotlib. The hook functions typically exhaust
42-
all pending events on the GUI event queue, run the main loop for a
43-
short fixed amount of time, or run the event loop until a key is
44-
pressed on stdin.
40+
event loop (the GUI event loop) with the python input prompt loop.
41+
Such hooks are usually included with the python bindings for GUI
42+
toolkits and may be registered on import. IPython also includes hooks
43+
for all of the GUI frameworks supported by matplotlib. The hook
44+
functions typically exhaust all pending events on the GUI event queue,
45+
run the main loop for a short fixed amount of time, or run the event
46+
loop until a key is pressed on stdin.
4547

4648
matplotlib does not currently do any management of `PyOS_InputHook`
4749
due to the wide range of ways that matplotlib is used. This
4850
management is left to the code using matplotlib. Interactive figures,
4951
even with matplotlib in 'interactive mode', may not work in the
5052
vanilla python repl if an appropriate `PyOS_InputHook` is not
5153
registered. We suggest using ``IPython``, which in addition to
52-
improving the command line, ensures that such a `PyOS_InptuHook`
54+
improving the command line, ensures that such a `PyOS_InputHook`
5355
function is registered for you GUI backend of choice.
5456

5557
A drawback of relying on `PyOS_InputHook` is that the GUI event loop
5658
is only processing events while python is otherwise idle and waiting
5759
for user input. If you want the GUI to be responsive during long
5860
running code it is necessary to periodically flush the GUI event
59-
queue. To achive this, almost all of the of the GUI-based ``Canvas``
61+
queue. To achieve this, almost all of the of the GUI-based ``Canvas``
6062
classes provide a `flush_event` method. By periodically calling this
6163
method the GUI will be updated and appear to be responsive.
6264

6365
In both cases, to schedule a re-draw of the figure at some point in
6466
the future use ``fig.canvas.draw_idle()``. This will defer the actual
65-
rendering of the figure until the GUI is ready to update it's
67+
rendering of the figure until the GUI is ready to update its
6668
on-screen representation.
6769

6870
Stale Artists

0 commit comments

Comments
 (0)