FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

DOC: Start to document interactive figures by tacaswell · Pull Request #4779 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cfa717a
DOC: Start to document interactive figures
tacaswell Jul 24, 2015
206f99c
DOC: improve text
tacaswell Jul 31, 2015
fa36c95
DOC: address comments
tacaswell Jan 7, 2017
8b28c01
DOC/WIP: updates to docs on how event loops work
tacaswell Jul 28, 2017
7189eed
DOC: add blocking_input docs
tacaswell Dec 28, 2017
98ae26c
WIP: Lots of text changes to interactive guide
tacaswell Dec 28, 2017
6263284
MNT: add warnings to Figure.show
tacaswell Dec 29, 2017
09deda3
DOC: re-arrange shell.rst and interactive.rst
tacaswell Jan 3, 2018
ec4230a
DOC/WIP: more edits and content
tacaswell Jul 10, 2018
d1a7a3e
WIP: more notes
tacaswell Mar 2, 2019
b49973a
DOC: merge the blocking API docs together
tacaswell Apr 28, 2020
bb8058a
DOC: remove rst files that have been merged into interactive.rst
tacaswell Apr 28, 2020
bc4ecd5
DOC: fix and sort intersphinx
tacaswell Apr 28, 2020
49f49fa
DOC: re-write pyplot.show docstring
tacaswell Apr 29, 2020
295d71d
DOC: plt.pause is no longer experimental
tacaswell Apr 29, 2020
c3c5013
DOC: update pyplot documentation
tacaswell Apr 30, 2020
d9df057
DOC: Lots of editing to interactive figure documentation
tacaswell Apr 30, 2020
7b0b327
DOC: it's -> its
tacaswell Apr 30, 2020
5a426d6
DOC: spelling
tacaswell Apr 30, 2020
8ab0a65
DOC: edits from review
tacaswell May 1, 2020
d70d5ad
DOC: update skipped references
tacaswell May 1, 2020
757e040
DOC: correct many spelling / grammer / clarity issues
tacaswell May 3, 2020
b0690ff
DOC: remove badly named and superfluous heading
tacaswell May 7, 2020
cc3ac5b
DOC: address review comments
tacaswell May 7, 2020
afe9edd
DOC: edits from review
tacaswell May 7, 2020
e09cab9
DOC: more small edits
tacaswell May 7, 2020
04f2fc6
DOC: fix spyder spelling
tacaswell May 7, 2020
9d842bf
DOC: edits from review
tacaswell May 7, 2020
41e19a8
MNT: remove unused import
tacaswell May 7, 2020
eda2ed3
DOC: edits from review
tacaswell May 9, 2020
7cf68e8
DOC: remove non-existent function call
tacaswell May 9, 2020
bfa3589
DOC: edits and duplicate removal
tacaswell May 9, 2020
6edcb47
DOC: windows not widows
tacaswell May 9, 2020
9b492bd
DOC: Revert all changes to blocking_input_api.rst
tacaswell May 9, 2020
6d4747f
DOC: reduce jargon and correct grammar
tacaswell May 20, 2020
f05ea3d
DOC: grammar / wording corrections from review
tacaswell May 20, 2020
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
DOC: address comments
  • Loading branch information
tacaswell committed May 1, 2020
commit fa36c95e074a7db6b1e787c665625afbb3325029
26 changes: 14 additions & 12 deletions doc/users/interactive_guide.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ a figure to inspect your data, however there is also a full mouse and
keyboard event handling system to enable building sophisticated interactive
graphs.

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


The GUI event loop
Expand All @@ -35,34 +37,34 @@ The python capi provides a hook, `PyOS_InputHook`, to register a
function to be run "The function will be called when Python's
interpreter prompt is about to become idle and wait for user input
from the terminal.". This hook can be used to integrate a second

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why "second event loop"? What would be the first event loop?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The python prompt itself.

event loop with the python repl. Such a hooks are usually included
with the python bindings for GUI toolkits and may be registered on
import. IPython also includes hooks for all of the GUI frameworks
supported by matplotlib. The hook functions typically exhaust
all pending events on the GUI event queue, run the main loop for a
short fixed amount of time, or run the event loop until a key is
pressed on stdin.
event loop (the GUI event loop) with the python input prompt loop.
Such hooks are usually included with the python bindings for GUI
toolkits and may be registered on import. IPython also includes hooks
for all of the GUI frameworks supported by matplotlib. The hook
functions typically exhaust all pending events on the GUI event queue,
run the main loop for a short fixed amount of time, or run the event
loop until a key is pressed on stdin.

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

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

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

Stale Artists
Expand Down

Back | FazBrowse Home | New Git URL