File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed
Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change 4040from matplotlib ._pylab_helpers import Gcf
4141from . import backend_webagg_core as core
4242
43- # TODO: This should really only be set for the IPython notebook, but
44- # I'm not sure how to detect that.
45- try :
46- __IPYTHON__
47- except :
48- _in_ipython = False
49- else :
50- _in_ipython = True
51-
5243
5344def new_figure_manager (num , * args , ** kwargs ):
5445 """
@@ -95,17 +86,7 @@ def mainloop(self):
9586 WebAggApplication .start ()
9687
9788
98- if not _in_ipython :
99- show = Show ()
100- else :
101- def show ():
102- from IPython .display import display_html
103-
104- result = []
105- import matplotlib ._pylab_helpers as pylab_helpers
106- for manager in pylab_helpers .Gcf ().get_all_fig_managers ():
107- result .append (ipython_inline_display (manager .canvas .figure ))
108- return display_html ('\n ' .join (result ), raw = True )
89+ show = Show ().mainloop
10990
11091
11192class ServerThread (threading .Thread ):
@@ -408,7 +389,7 @@ def ipython_inline_display(figure):
408389 fig_id = fignum ,
409390 toolitems = core .NavigationToolbar2WebAgg .toolitems ,
410391 canvas = figure .canvas ,
411- port = WebAggApplication .port )
392+ port = WebAggApplication .port ). decode ( 'utf-8' )
412393
413394
414395FigureCanvas = FigureCanvasWebAgg
You can’t perform that action at this time.
0 commit comments