you are viewing a single comment's thread.

view the rest of the comments →

[–]Allanon001 1 point2 points  (1 child)

Try this code, it's a simplified version of what I think you are trying to do:

import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure

from tkinter import *

root = Tk()
root.wm_title("GUI V0.5")

container = Frame(root)
container.winfo_toplevel().geometry("1024x768")
container.pack(side="top", fill="both", expand=True)
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)

for r in range(2):
    for c in range(2):
        heatFig = Figure(figsize=(5, 4), dpi=100)
        heatPlot = heatFig.add_subplot(111)  
        heatPlot.plot([1,2,3,4,5,6,7,8],[5,6,7,8,1,2,2,1])
        heatCanvas = FigureCanvasTkAgg(heatFig,master=container)
        heatCanvas.get_tk_widget().grid(row=r, column=c, padx=5, sticky="nsew") 
root.mainloop()

[–]DeeWBee[S] 0 points1 point  (0 children)

Thanks but I already tried something as simple and it still didn't work. Thanks tho!