-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Start to document interactive figures #4779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
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 206f99c
DOC: improve text
tacaswell fa36c95
DOC: address comments
tacaswell 8b28c01
DOC/WIP: updates to docs on how event loops work
tacaswell 7189eed
DOC: add blocking_input docs
tacaswell 98ae26c
WIP: Lots of text changes to interactive guide
tacaswell 6263284
MNT: add warnings to Figure.show
tacaswell 09deda3
DOC: re-arrange shell.rst and interactive.rst
tacaswell ec4230a
DOC/WIP: more edits and content
tacaswell d1a7a3e
WIP: more notes
tacaswell b49973a
DOC: merge the blocking API docs together
tacaswell bb8058a
DOC: remove rst files that have been merged into interactive.rst
tacaswell bc4ecd5
DOC: fix and sort intersphinx
tacaswell 49f49fa
DOC: re-write pyplot.show docstring
tacaswell 295d71d
DOC: plt.pause is no longer experimental
tacaswell c3c5013
DOC: update pyplot documentation
tacaswell d9df057
DOC: Lots of editing to interactive figure documentation
tacaswell 7b0b327
DOC: it's -> its
tacaswell 5a426d6
DOC: spelling
tacaswell 8ab0a65
DOC: edits from review
tacaswell d70d5ad
DOC: update skipped references
tacaswell 757e040
DOC: correct many spelling / grammer / clarity issues
tacaswell b0690ff
DOC: remove badly named and superfluous heading
tacaswell cc3ac5b
DOC: address review comments
tacaswell afe9edd
DOC: edits from review
tacaswell e09cab9
DOC: more small edits
tacaswell 04f2fc6
DOC: fix spyder spelling
tacaswell 9d842bf
DOC: edits from review
tacaswell 41e19a8
MNT: remove unused import
tacaswell eda2ed3
DOC: edits from review
tacaswell 7cf68e8
DOC: remove non-existent function call
tacaswell bfa3589
DOC: edits and duplicate removal
tacaswell 6edcb47
DOC: windows not widows
tacaswell 9b492bd
DOC: Revert all changes to blocking_input_api.rst
tacaswell 6d4747f
DOC: reduce jargon and correct grammar
tacaswell f05ea3d
DOC: grammar / wording corrections from review
tacaswell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
DOC: reduce jargon and correct grammar
- Loading branch information
commit 6d4747f9b6aa9c7c12c83cc447595ee2c2c43db1
There are no files selected for viewing
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 |
---|---|---|
|
@@ -146,34 +146,45 @@ Interactive mode controls: | |
|
||
- whether created figures are automatically shown | ||
- whether changes to artists automatically trigger re-drawing existing figures | ||
- whether `.pyplot.show` blocks or not | ||
- whether `.pyplot.show` returns immediately or after all of the | ||
figures have been closed when given no arguments | ||
|
||
|
||
If in interactive mode, then: | ||
|
||
- newly created figures will be shown immediately | ||
- figures will automatically redraw on change | ||
- pyplot.show will not block by default | ||
- pyplot.show will return immediately by default | ||
|
||
If not in interactive mode then: | ||
|
||
- newly created figures and changes to figures will | ||
not be reflected until explicitly asked to be | ||
- pyplot.show will block by default | ||
- pyplot.show runs the GUI event loop and does not return until all of | ||
the plot windows are closed | ||
|
||
|
||
If you are in non-interactive mode (or created figures while in | ||
non-interactive mode) you may need to explicitly call `.pyplot.show` | ||
to bring the windows onto your screen. If you only want to run the | ||
GUI event loop for a fixed amount of time you can use `.pyplot.pause`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Being in interactive mode is orthogonal to the GUI event loop being | ||
integrated with your command prompt. If you have the GUI event loop | ||
integrated with your prompt, then shown figures will be "live" while | ||
the prompt is waiting for input, if it is not integrated then your | ||
figures will only be "live" when the GUI event loop is running (via | ||
`.pyplot.show`, `.pyplot.pause`, or explicitly starting the GUI main | ||
loop). | ||
This will both block the progress of your code (as if you had called | ||
`time.sleep`), raise ensure the current window is shown and if needed | ||
tacaswell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
re-drawn, and run the GUI event loop (so the windows are "live" for | ||
intrection) for the specified period of time. | ||
tacaswell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Being in "interactive mode" is orthogonal to the GUI event loop being | ||
integrated with your command prompt. If you use `pyplot.ion`, but | ||
have not arrange for the event loop integration your figures will | ||
tacaswell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
appear but will not be "live" while the prompt is waiting for input. | ||
You will not be able to pan/zoom and the figure may not even render | ||
(the window might appear black, transparent, or as a snapshot the | ||
tacaswell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
desktop under it). Conversely, if you configure the event loop | ||
integration displayed figures will be "live" while waiting for input | ||
at the prompt independent of pyplot's "interactive mode". In either | ||
tacaswell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
case, the figures will be "live" if you use | ||
``pyplot.show(block=True)``, `.pyplot.pause`, or run the the GUI main | ||
loop in some other way. | ||
|
||
|
||
.. warning:: | ||
|
@@ -276,8 +287,7 @@ If you only need to use the classic notebook you can use | |
%matplotlib notebook | ||
|
||
which uses the `.backend_nbagg` backend which ships with Matplotlib. | ||
However nbagg does not work in Jupyter Lab due to changes in the front | ||
end. | ||
However nbagg does not work in Jupyter Lab. | ||
|
||
GUIs + jupyter | ||
~~~~~~~~~~~~~~ | ||
|
@@ -295,5 +305,5 @@ the figure (if it does not raise an exception outright). | |
PyCharm, Spyder, and VSCode | ||
--------------------------- | ||
|
||
Many IDEs have built-in integration with Matplotlib, please consult its | ||
Many IDEs have built-in integration with Matplotlib, please consult their | ||
documentation for configuration details. |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-> "GUI event loop and block for a fixed amount of time..." In the typical (I suspect) use case, the key desired behavior is the blocking, not the interactivity via the GUI event loop.