From 3e0ef22121d3858206f9af1787bf79108f9f2ed6 Mon Sep 17 00:00:00 2001 From: Paul Bustios Date: Tue, 2 Aug 2016 17:55:56 -0300 Subject: [PATCH 1/2] Bug fix in show_matplotlib --- python/src/main/resources/bootstrap.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/python/src/main/resources/bootstrap.py b/python/src/main/resources/bootstrap.py index 638ef9ba54a..f16f1c89998 100644 --- a/python/src/main/resources/bootstrap.py +++ b/python/src/main/resources/bootstrap.py @@ -166,16 +166,9 @@ def show_matplotlib(self, p, width="0", height="0", **kwargs): """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
" + img.read() + "
") + p.savefig(img, format="svg") + html = "%html
{image}
" + print(html.format(width=width, height=height, image=img.getvalue())) img.close() From 82c631a20ddbe45df3d49eb9803dbc1ca2eaa1f1 Mon Sep 17 00:00:00 2001 From: Paul Bustios Date: Tue, 2 Aug 2016 18:35:53 -0300 Subject: [PATCH 2/2] Add 100% as a default value for width and height z.show() parameters --- python/src/main/resources/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/main/resources/bootstrap.py b/python/src/main/resources/bootstrap.py index f16f1c89998..0290c5f9509 100644 --- a/python/src/main/resources/bootstrap.py +++ b/python/src/main/resources/bootstrap.py @@ -162,7 +162,7 @@ def show_dataframe(self, df, **kwargs): #) body_buf.close(); header_buf.close() - def show_matplotlib(self, p, width="0", height="0", **kwargs): + def show_matplotlib(self, p, width="100%", height="100%", **kwargs): """Matplotlib show function """ img = io.StringIO()