Код: Выделить всё
import customtkinter as ctk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
# create the window using CTK
window = ctk.CTk()
# create the plot of random data
data = [1, 2, 3, 4, 5]
plt.plot(data)
# Add the plot to the window
canvas = FigureCanvasTkAgg(plt.gcf(), master=window)
canvas.draw()
canvas.get_tk_widget().pack(side='top', fill='both', expand=True)
exit_button = ctk.CTkButton(window, text='Exit', command=window.destroy)
exit_button.pack(side='bottom') # add the exit button to the window
window.mainloop()
Код: Выделить всё
invalid command name "2607166565512update"
while executing
"2607166565512update"
("after" script)
invalid command name "2607167621640check_dpi_scaling"
while executing
"2607167621640check_dpi_scaling"
("after" script)
invalid command name "2607249791944_click_animation"
while executing
"2607249791944_click_animation"
("after" script)
Подробнее здесь: https://stackoverflow.com/questions/785 ... ctk-window