def graph1(self, data, row_a): """Graphs the raw CPD data""" plt.close() plt.figure(figsize=(3.5, 3.5), dpi=100, frameon=False) im = plt.imshow(data, cmap='jet') plt.colorbar(im, orientation='vertical', fraction=0.046, pad=0.05) plt.tight_layout() plt.savefig(path.join(tmpdir, im_name1), dpi=100, bbox_inches='tight') c = Canvas(self, width=350, height=350, bg='white') c.grid(row=row_a, column=5, columnspan=2, rowspan=50, sticky=(W, N), padx=50) c.background = PhotoImage(file=path.join(tmpdir, im_name1)) c.create_image(1, 20, image=c.background, anchor=NW)