def add_images_section(self): style = "width:65%" import pylab pylab.ioff() def plotter1(filename): self.bam.plot_bar_flags(logy=True, filename=filename) html1 = self.create_embedded_png(plotter1, "filename", style=style) def plotter2(filename): self.bam.plot_bar_flags(logy=False, filename=filename) html2 = self.create_embedded_png(plotter2, "filename", style=style) def plotter3(filename): self.bam.plot_bar_mapq(filename=filename) html3 = self.create_embedded_png(plotter3, "filename", style=style) self.sections.append({ "name": "Image", "anchor": "table", "content": html1 + html2 + html3 })
def plotter(filename, key): name = key.replace(" ", "_") pylab.ioff() histograms[key].plot(logy=False, lw=2, marker="o") pylab.title(name + "(%s)" % count) pylab.grid(True) pylab.savefig(filename) pylab.close() # need to close the figure otherwise warnings
def add_images_section(self): style = "width:65%" import pylab pylab.ioff() def plotter1(filename): pylab.clf() self.trf.hist_entropy() pylab.savefig(filename) html1 = self.create_embedded_png(plotter1, "filename", style=style) def plotter2(filename): pylab.clf() self.trf.hist_period_size() pylab.savefig(filename) html2 = self.create_embedded_png(plotter2, "filename", style=style) self.sections.append({ "name": "Image", "anchor": "table", "content": html1 + html2 })