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

Skip to content

Commit 468f6e0

Browse files
committed
FIX: add explict draw_if_interactive in figure()
With out this the IPython inline backend does not work without calling `plt.show()` or `plt.draw_if_interactive()`. Adding this line back here is a quick hack to get things working again. There is probably a better solution in the figure manager base-class. Closes #4774
1 parent 4b25853 commit 468f6e0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/pyplot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,13 @@ def make_active(event):
531531
_pylab_helpers.Gcf.set_active(figManager)
532532
figManager.canvas.figure.number = num
533533

534+
# make sure backends (inline) that we don't ship that expect this
535+
# to be called in plotting commands to make the figure call show
536+
# still work. There is probably a better way to do this in the
537+
# FigureManager base class.
538+
if matplotlib.is_interactive():
539+
draw_if_interactive()
540+
534541
if _INSTALL_FIG_OBSERVER:
535542
figManager.canvas.figure.add_callback(_auto_draw_if_interactive)
536543

0 commit comments

Comments
 (0)