Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace reference to %pylab by %matplotlib. #26516

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 1 commit into from
Aug 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3412,9 +3412,9 @@ def show(cls, *, block=None):
"""
Show all figures.

`show` blocks by calling `mainloop` if *block* is ``True``, or if it
is ``None`` and we are neither in IPython's ``%pylab`` mode, nor in
`interactive` mode.
`show` blocks by calling `mainloop` if *block* is ``True``, or if it is
``None`` and we are not in `interactive` mode and if IPython's
``%matplotlib`` integration has not been activated.
"""
managers = Gcf.get_all_fig_managers()
if not managers:
Expand All @@ -3427,9 +3427,9 @@ def show(cls, *, block=None):
if cls.mainloop is None:
return
if block is None:
# Hack: Are we in IPython's %pylab mode? In pylab mode, IPython
# (>= 0.10) tacks a _needmain attribute onto pyplot.show (always
# set to False).
# Hack: Is IPython's %matplotlib integration activated? If so,
# IPython's activate_matplotlib (>= 0.10) tacks a _needmain
# attribute onto pyplot.show (always set to False).
pyplot_show = getattr(sys.modules.get("matplotlib.pyplot"), "show", None)
ipython_pylab = hasattr(pyplot_show, "_needmain")
block = not ipython_pylab and not is_interactive()
Expand Down