Remove output handler -- we have a better, interactive thing now

This commit is contained in:
Michael Droettboom 2018-05-22 11:33:52 -04:00
parent 5f8bd963b7
commit b0a9b8ea16
1 changed files with 0 additions and 21 deletions

View File

@ -1,21 +0,0 @@
diff -ur matplotlib-2.2.2/lib/matplotlib/figure.py matplotlib-2.2.2/lib/matplotlib/figure.py
--- a/lib/matplotlib/figure.py 2018-03-05 23:47:09.000000000 -0500
+++ b/lib/matplotlib/figure.py 2018-05-17 10:46:52.355306452 -0400
@@ -420,6 +420,17 @@
from matplotlib.backends import backend_webagg
return backend_webagg.ipython_inline_display(self)
+ def _repr_html_(self):
+ from js import document
+ import io
+ import base64
+ png_data = io.BytesIO()
+ self.savefig(png_data, format='png')
+ img = document.createElement('img')
+ img.src = 'data:image/png;base64,' + \
+ base64.b64encode(png_data.getvalue()).decode('ascii')
+ return img
+
def show(self, warn=True):
"""
If using a GUI backend with pyplot, display the figure window.