mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Add comment explaining the need for decoding bytes to string
This commit is contained in:
parent
1a78a37d0f
commit
b3c74a8883
1 changed files with 3 additions and 1 deletions
|
|
@ -173,7 +173,9 @@ class PyZeppelinContext(object):
|
|||
p.savefig(img, format=fmt)
|
||||
img_str = b"data:image/png;base64,"
|
||||
img_str += base64.b64encode(img.getvalue().strip())
|
||||
img_str = "<img src={img}>".format(img=img_str.decode("ascii"))
|
||||
# Decoding img_str is necessary for Python 3 compability
|
||||
img_str = img_str.decode("ascii")
|
||||
img_str = "<img src={img}>".format(img=img_str)
|
||||
elif fmt == "svg":
|
||||
img = StringIO()
|
||||
p.savefig(img, format=fmt)
|
||||
|
|
|
|||
Loading…
Reference in a new issue