@@ -146,34 +146,45 @@ Interactive mode controls:
146
146
147
147
- whether created figures are automatically shown
148
148
- 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
150
151
151
152
152
153
If in interactive mode, then:
153
154
154
155
- newly created figures will be shown immediately
155
156
- figures will automatically redraw on change
156
- - pyplot.show will not block by default
157
+ - pyplot.show will return immediately by default
157
158
158
159
If not in interactive mode then:
159
160
160
161
- newly created figures and changes to figures will
161
162
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
163
165
164
166
165
167
If you are in non-interactive mode (or created figures while in
166
168
non-interactive mode) you may need to explicitly call `.pyplot.show `
167
169
to bring the windows onto your screen. If you only want to run the
168
170
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.
177
188
178
189
179
190
.. warning ::
@@ -276,8 +287,7 @@ If you only need to use the classic notebook you can use
276
287
%matplotlib notebook
277
288
278
289
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.
281
291
282
292
GUIs + jupyter
283
293
~~~~~~~~~~~~~~
@@ -295,5 +305,5 @@ the figure (if it does not raise an exception outright).
295
305
PyCharm, Spyder, and VSCode
296
306
---------------------------
297
307
298
- Many IDEs have built-in integration with Matplotlib, please consult its
308
+ Many IDEs have built-in integration with Matplotlib, please consult their
299
309
documentation for configuration details.
0 commit comments