mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
fix matplotlib display error on python 3.4
This commit is contained in:
parent
3e6603b163
commit
c5e584af9a
1 changed files with 5 additions and 1 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import uuid
|
||||
import warnings
|
||||
import base64
|
||||
|
|
@ -94,7 +95,10 @@ class FigureCanvasZInline(FigureCanvasAgg):
|
|||
buf = BytesIO()
|
||||
self.print_figure(buf, **kwargs)
|
||||
fmt = fmt.encode()
|
||||
byte_str = b"data:image/%s;base64," %fmt
|
||||
if sys.version_info >= (3, 4) and sys.version_info < (3, 5):
|
||||
byte_str = bytes("data:image/%s;base64," %fmt, "utf-8")
|
||||
else:
|
||||
byte_str = b"data:image/%s;base64," %fmt
|
||||
byte_str += base64.b64encode(buf.getvalue())
|
||||
|
||||
# Python3 forces all strings to default to unicode, but for raster image
|
||||
|
|
|
|||
Loading…
Reference in a new issue