Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.6.1, 0.7.0
-
None
Description
The current implementation of z.show() supports matplotlib plotting svg images inline. However with some type of plots in matplotlib, particularly for maps via basemap, this causes the UI in the notebook to severely lag when the output isn't hidden. Saving the images in .png format solves this problem, but a different implementation is required in order to plot the image inline. I have proposed a solution below where the image is saved into a byte array and then displayed directly via html:
import cStringIO import base64 def show(p): img = cStringIO.StringIO() p.savefig(img, format='png') imgStr = "data:image/png;base64," imgStr += base64.b64encode(img.getvalue().strip()) print "%html <img src='" + imgStr + "'>"
I will incorporate this into zeppelin's z.show() function.
Attachments
Issue Links
- links to