@@ -92,7 +92,7 @@ def _backend_selection():
92
92
## Global ##
93
93
94
94
from matplotlib .backends import pylab_setup
95
- new_figure_manager , draw_if_interactive , show = pylab_setup ()
95
+ new_figure_manager , draw_if_interactive , _show = pylab_setup ()
96
96
97
97
@docstring .copy_dedent (Artist .findobj )
98
98
def findobj (o = None , match = None ):
@@ -113,16 +113,28 @@ def switch_backend(newbackend):
113
113
Calling this command will close all open windows.
114
114
"""
115
115
close ('all' )
116
- global new_figure_manager , draw_if_interactive , show
116
+ global new_figure_manager , draw_if_interactive , _show
117
117
matplotlib .use (newbackend , warn = False )
118
118
reload (matplotlib .backends )
119
119
from matplotlib .backends import pylab_setup
120
- new_figure_manager , draw_if_interactive , show = pylab_setup ()
120
+ new_figure_manager , draw_if_interactive , _show = pylab_setup ()
121
+
122
+
123
+ def show ():
124
+ """
125
+ In non-interactive mode, display all figures and block until
126
+ the figures have been closed; in interactive mode it has no
127
+ effect unless figures were created prior to a change from
128
+ non-interactive to interactive mode (not recommended). In
129
+ that case it displays the figures but does not block.
130
+ """
131
+ global _show
132
+ _show ()
121
133
122
134
123
135
def isinteractive ():
124
136
"""
125
- Return the interactive status
137
+ Return *True* if matplotlib is in interactive mode, *False* otherwise.
126
138
"""
127
139
return matplotlib .is_interactive ()
128
140
@@ -354,7 +366,25 @@ def clf():
354
366
draw_if_interactive ()
355
367
356
368
def draw ():
357
- 'redraw the current figure'
369
+ """
370
+ Redraw the current figure.
371
+
372
+ This is used in interactive mode to update a figure that
373
+ has been altered using one or more plot object method calls;
374
+ it is not needed if figure modification is done entirely
375
+ with pyplot functions, if a sequence of modifications ends
376
+ with a pyplot function, or if matplotlib is in non-interactive
377
+ mode and the sequence of modifications ends with :func:`show` or
378
+ :func:`savefig`.
379
+
380
+ A more object-oriented alternative, given any
381
+ :class:`~matplotlib.figure.Figure` instance, :attr:`fig`, that
382
+ was created using a :module:`~matplotlib.pyplot` function, is::
383
+
384
+ fig.canvas.draw()
385
+
386
+
387
+ """
358
388
get_current_fig_manager ().canvas .draw ()
359
389
360
390
@docstring .copy_dedent (Figure .savefig )
@@ -1386,7 +1416,9 @@ def plotting():
1386
1416
setp set a graphics property
1387
1417
semilogx log x axis
1388
1418
semilogy log y axis
1389
- show show the figures
1419
+ show in non-interactive mode, display all figures and block
1420
+ until they have been closed; in interactive mode,
1421
+ show generally has no effect.
1390
1422
specgram a spectrogram plot
1391
1423
stem make a stem plot
1392
1424
subplot make a subplot (numrows, numcols, axesnum)
0 commit comments