def get_db_plot(self, plot_manager, title, x_label, y_label, field1, field2, filename): fig = None imgdata = None plot_manager = Plot_Data() uri = plot_manager.get_plot_db_results( title, x_label, y_label, field1, field2, filename) html = '<img src = "%s" witdh="300px" height="300px" /> <br />' % uri return html
def read_dat_plot(self, plot_manager, path_file, title, x_label, y_label, filename): fig = None imgdata = None plot_manager = Plot_Data() uri = plot_manager.get_plot_results(path_file, title, x_label, y_label, filename) # fig = plt.gcf() # imgdata = StringIO.StringIO() # fig.savefig(imgdata, format='png') # imgdata.seek(0) # rewind the data #html = "Content-type: image/png\n" # uri = 'data:image/png;base64,' + urllib.quote(base64.b64encode(imgdata.buf)) html = '<img src = "%s" witdh="300px" height="300px" /> <br />' % uri return html