Convert plot to HTML user Kantale
From PyPedia
Contents |
[edit] Documentation
Convert a plot from matplotlib to html content.
Reference
[edit] Parameters
<inputs> </inputs>
[edit] Return
The string that can be injected to HTML in order to show the plot
[edit] See also
[edit] Code
import matplotlib.pyplot as plt import StringIO import urllib, base64 def Convert_plot_to_HTML_user_Kantale(plot): fig = plot.gcf() imgdata = StringIO.StringIO() fig.savefig(imgdata, format='png') imgdata.seek(0) # rewind the data uri = 'data:image/png;base64,' + urllib.quote(base64.b64encode(imgdata.buf)) return '<img src = "%s"/>' % uri
[edit] Unit Tests
def uni1(): return True
[edit] Development Code
def Convert_plot_to_HTML_user_Kantale(): pass
[edit] Permissions
[edit] Documentation Permissions
Kantale
[edit] Code Permissions
Kantale
[edit] Unit Tests Permissions
Kantale