Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4d80e5

Browse files
committed
Convert block=None to block=True
Fix doc
1 parentd69e9ee commitd4d80e5

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

‎lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,11 @@ def draw_if_interactive(cls):
177177
cls.trigger_manager_draw(manager)
178178

179179
@classmethod
180-
defshow(cls,block=None):
180+
defshow(cls,block=True):
181181
"""Show all figures.
182182
183-
`show` blocks by calling `mainloop` if *block* is ``True``, or if it
184-
is ``None`` and we are neither in IPython's ``%pylab`` mode, nor in
185-
`interactive` mode.
183+
`show` blocks by calling `mainloop` if *block* is ``True`` and we are
184+
neither in IPython's ``%pylab`` mode, nor in `interactive` mode.
186185
"""
187186
managers=Gcf.get_all_fig_managers()
188187
ifnotmanagers:
@@ -198,7 +197,7 @@ def show(cls, block=None):
198197
return
199198
ifcls.mainloopisNone:
200199
return
201-
ifblockisNone:
200+
ifblock:
202201
# Hack: Are we in IPython's pylab mode?
203202
frommatplotlibimportpyplot
204203
try:
@@ -210,8 +209,6 @@ def show(cls, block=None):
210209
block=notipython_pylabandnotis_interactive()
211210
# TODO: The above is a hack to get the WebAgg backend working with
212211
# ipython's `%pylab` mode until proper integration is implemented.
213-
ifget_backend()=="WebAgg":
214-
block=True
215212
ifblock:
216213
cls.mainloop()
217214

@@ -244,7 +241,7 @@ class ShowBase(_Backend):
244241
Subclass must override mainloop() method.
245242
"""
246243

247-
def__call__(self,block=None):
244+
def__call__(self,block=True):
248245
returnself.show(block=block)
249246

250247

@@ -2635,7 +2632,7 @@ def notify_axes_change(fig):
26352632
ifself.toolmanagerisNoneandself.toolbarisnotNone:
26362633
self.toolbar.update()
26372634

2638-
defshow(self):
2635+
defshow(self,block=True):
26392636
"""
26402637
For GUI backends, show the figure window and redraw.
26412638
For non-GUI backends, raise an exception to be caught

‎lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def trigger_manager_draw(manager):
242242
manager.show()
243243

244244
@staticmethod
245-
defshow(*args,**kwargs):
245+
defshow(block=True):
246246
## TODO: something to do when keyword block==False ?
247247
frommatplotlib._pylab_helpersimportGcf
248248

‎lib/matplotlib/backends/backend_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def draw_if_interactive():
172172
"""
173173

174174

175-
defshow(block=None):
175+
defshow(block=True):
176176
"""
177177
For image backends - is not required
178178
For GUI backends - show() is usually the last line of a pylab script and

‎lib/matplotlib/backends/backend_webagg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,10 @@ def trigger_manager_draw(manager):
319319
manager.canvas.draw_idle()
320320

321321
@staticmethod
322-
defshow():
322+
defshow(block=True):
323+
ifnotblock:
324+
warnings.warn('The webagg backend does not support "block=False"')
325+
block=True
323326
WebAggApplication.initialize()
324327

325328
url="http://127.0.0.1:{port}{prefix}".format(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp