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 40
40
from matplotlib ._pylab_helpers import Gcf
41
41
from . import backend_webagg_core as core
42
42
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
-
52
43
53
44
def new_figure_manager (num , * args , ** kwargs ):
54
45
"""
@@ -95,17 +86,7 @@ def mainloop(self):
95
86
WebAggApplication .start ()
96
87
97
88
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
109
90
110
91
111
92
class ServerThread (threading .Thread ):
@@ -408,7 +389,7 @@ def ipython_inline_display(figure):
408
389
fig_id = fignum ,
409
390
toolitems = core .NavigationToolbar2WebAgg .toolitems ,
410
391
canvas = figure .canvas ,
411
- port = WebAggApplication .port )
392
+ port = WebAggApplication .port ). decode ( 'utf-8' )
412
393
413
394
414
395
FigureCanvas = FigureCanvasWebAgg
You can’t perform that action at this time.
0 commit comments