I want to put matplotlib into a main tkinter window but after following numerous tutorials, I am still struggling to put matplotlib in the main window.
The reason why i need it is because im trying to make a graphing software for a school project.
any help will be much appreciated, here is my code so far..
from tkinter import * #importing all files from Tkinter so all libraries are avaiable
root = Tk() #root is a variable which equals a tkinter class - creates blank window
root.geometry('1600x900') # Size 1600, 900 for the window
#-----------------------------------------------------------------------
---------------
button1xy = Button(text="xy")
buttony = Button(text="y=")
buttonclrscrn = Button(text="clear screen")
buttonbestfit = Button(text="line of best fit")#labels for the buttons
button1xy.grid(row=0)
buttony.grid(row=0, column=1)
buttonclrscrn.grid(row=0, column=2)
buttonbestfit.grid(row=0, column=3) #displaying them on the screen,
grid method
menu = Menu(root)
root.config(menu=menu)
def dropdownmenu():
submenu = Menu(menu)
menu.add_cascade(label=">", menu=submenu)
submenu.add_command(label="Linear")
submenu.add_command(label="Polynomial")
submenu.add_command(label="Trigonometrical")
submenu.add_command(label="Percentage Error") #drop down menu
which appears in toolbar when button is clicked on
buttonmenu = Button(text=">", command=dropdownmenu) #label and
command for the drop down menu button
buttonmenu.grid(row=0, column=8) #grid method for it to display
#-------------------------------------------------------------------
root.mainloop() #continuously keeps window on the screen until closed
#generates window