mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Bug fix in show_matplotlib
This commit is contained in:
parent
6f867ceb0c
commit
3e0ef22121
1 changed files with 3 additions and 10 deletions
|
|
@ -166,16 +166,9 @@ class PyZeppelinContext(object):
|
|||
"""Matplotlib show function
|
||||
"""
|
||||
img = io.StringIO()
|
||||
p.savefig(img, format='svg')
|
||||
img.seek(0)
|
||||
style = ""
|
||||
if (width != "0"):
|
||||
style += 'width:' + width
|
||||
if (height != "0"):
|
||||
if (len(style) != 0):
|
||||
style += ","
|
||||
style += 'height:' + height
|
||||
print("%html <div style='" + style + "'>" + img.read() + "<div>")
|
||||
p.savefig(img, format="svg")
|
||||
html = "%html <div style='width:{width};height:{height}'>{image}<div>"
|
||||
print(html.format(width=width, height=height, image=img.getvalue()))
|
||||
img.close()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue