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

Skip to content

Commit d8f6ec9

Browse files
committed
Use IPython.display.display_html as suggested by @andreabedini
1 parent 8e90fee commit d8f6ec9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/matplotlib/backends/backend_webagg.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,13 @@ def mainloop(self):
7373
show = Show()
7474
else:
7575
def show():
76-
class RawHTML(object):
77-
def __init__(self, content):
78-
self._content = content
79-
80-
def _repr_html_(self):
81-
return self._content
76+
from IPython.display import display_html
8277

8378
result = []
8479
import matplotlib._pylab_helpers as pylab_helpers
8580
for manager in pylab_helpers.Gcf().get_all_fig_managers():
8681
result.append(ipython_inline_display(manager.canvas.figure))
87-
return RawHTML('\n'.join(result))
82+
return display_html('\n'.join(result), raw=True)
8883

8984

9085
class ServerThread(threading.Thread):

0 commit comments

Comments
 (0)