File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 4141#import matplotlib.path as path
4242from matplotlib import rcParams
4343from matplotlib import is_interactive
44+ from matplotlib import get_backend
4445from matplotlib ._pylab_helpers import Gcf
4546
4647from matplotlib .transforms import Bbox , TransformedBbox , Affine2D
@@ -100,6 +101,10 @@ def __call__(self, block=None):
100101 # IPython versions >= 0.10 tack the _needmain
101102 # attribute onto pyplot.show, and always set
102103 # it to False, when in --pylab mode.
104+ ipython_pylab = ipython_pylab and get_backend () != 'WebAgg'
105+ # TODO: The above is a hack to get the WebAgg backend
106+ # working with `ipython --pylab` until proper integration
107+ # is implemented.
103108 except AttributeError :
104109 ipython_pylab = False
105110
@@ -108,7 +113,7 @@ def __call__(self, block=None):
108113 if ipython_pylab :
109114 return
110115
111- if not is_interactive ():
116+ if not is_interactive () or get_backend () == 'WebAgg' :
112117 self .mainloop ()
113118
114119 def mainloop (self ):
You can’t perform that action at this time.
0 commit comments