Skip to content

Commit 6d4747f

Browse files
committed
DOC: reduce jargon and correct grammar
1 parent 9b492bd commit 6d4747f

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

doc/users/interactive.rst

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,34 +146,45 @@ Interactive mode controls:
146146

147147
- whether created figures are automatically shown
148148
- whether changes to artists automatically trigger re-drawing existing figures
149-
- whether `.pyplot.show` blocks or not
149+
- whether `.pyplot.show` returns immediately or after all of the
150+
figures have been closed when given no arguments
150151

151152

152153
If in interactive mode, then:
153154

154155
- newly created figures will be shown immediately
155156
- figures will automatically redraw on change
156-
- pyplot.show will not block by default
157+
- pyplot.show will return immediately by default
157158

158159
If not in interactive mode then:
159160

160161
- newly created figures and changes to figures will
161162
not be reflected until explicitly asked to be
162-
- pyplot.show will block by default
163+
- pyplot.show runs the GUI event loop and does not return until all of
164+
the plot windows are closed
163165

164166

165167
If you are in non-interactive mode (or created figures while in
166168
non-interactive mode) you may need to explicitly call `.pyplot.show`
167169
to bring the windows onto your screen. If you only want to run the
168170
GUI event loop for a fixed amount of time you can use `.pyplot.pause`.
169-
170-
Being in interactive mode is orthogonal to the GUI event loop being
171-
integrated with your command prompt. If you have the GUI event loop
172-
integrated with your prompt, then shown figures will be "live" while
173-
the prompt is waiting for input, if it is not integrated then your
174-
figures will only be "live" when the GUI event loop is running (via
175-
`.pyplot.show`, `.pyplot.pause`, or explicitly starting the GUI main
176-
loop).
171+
This will both block the progress of your code (as if you had called
172+
`time.sleep`), raise ensure the current window is shown and if needed
173+
re-drawn, and run the GUI event loop (so the windows are "live" for
174+
intrection) for the specified period of time.
175+
176+
Being in "interactive mode" is orthogonal to the GUI event loop being
177+
integrated with your command prompt. If you use `pyplot.ion`, but
178+
have not arrange for the event loop integration your figures will
179+
appear but will not be "live" while the prompt is waiting for input.
180+
You will not be able to pan/zoom and the figure may not even render
181+
(the window might appear black, transparent, or as a snapshot the
182+
desktop under it). Conversely, if you configure the event loop
183+
integration displayed figures will be "live" while waiting for input
184+
at the prompt independent of pyplot's "interactive mode". In either
185+
case, the figures will be "live" if you use
186+
``pyplot.show(block=True)``, `.pyplot.pause`, or run the the GUI main
187+
loop in some other way.
177188

178189

179190
.. warning::
@@ -276,8 +287,7 @@ If you only need to use the classic notebook you can use
276287
%matplotlib notebook
277288

278289
which uses the `.backend_nbagg` backend which ships with Matplotlib.
279-
However nbagg does not work in Jupyter Lab due to changes in the front
280-
end.
290+
However nbagg does not work in Jupyter Lab.
281291

282292
GUIs + jupyter
283293
~~~~~~~~~~~~~~
@@ -295,5 +305,5 @@ the figure (if it does not raise an exception outright).
295305
PyCharm, Spyder, and VSCode
296306
---------------------------
297307

298-
Many IDEs have built-in integration with Matplotlib, please consult its
308+
Many IDEs have built-in integration with Matplotlib, please consult their
299309
documentation for configuration details.

doc/users/interactive_guide.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ Command Prompt Integration
7575
==========================
7676

7777
So far, so good. We have the REPL (like the IPython terminal) that
78-
lets us interactively send things code to the interpreter and get
79-
results back. We also have the GUI toolkit that runs an event loop
80-
waiting for user input and lets us register functions to be run when
81-
that happens. However, if we want to do both we have a problem: the
82-
prompt and the GUI event loop are both infinite loops that each think
83-
*they* are in charge! In order for both the prompt and the GUI windows
84-
to be responsive we need a method to allow the loops to 'timeshare' :
78+
lets us interactively send code to the interpreter and get results
79+
back. We also have the GUI toolkit that runs an event loop waiting
80+
for user input and lets us register functions to be run when that
81+
happens. However, if we want to do both we have a problem: the prompt
82+
and the GUI event loop are both infinite loops that each think *they*
83+
are in charge! In order for both the prompt and the GUI windows to be
84+
responsive we need a method to allow the loops to 'timeshare' :
8585

8686
1. let the GUI main loop block the python process when you want
8787
interactive windows

0 commit comments

Comments
 (0)