我如何在 tkinter 上创建一个打开 matplotlib 图的按钮
How do i create a button on tkinter that opens up a matplotlib graph
我正在尝试在 tkinter 上创建一个按钮来打开 matplotlib 按钮,但我不知道该怎么做。
我不知道你想要什么,但你想将 matplotlib 图形放在 def 中,并使该命令的按钮像这样
import tkinter as tk
from tkinter import Button
root = tk.Tk()
root.geometry('300x400')
def mathplotlibgraph():
mathplotlibcode
b1 = Button(root, text = 'Mathplotlib', command = mathplotlibgraph)
b1.pack()
我正在尝试在 tkinter 上创建一个按钮来打开 matplotlib 按钮,但我不知道该怎么做。
我不知道你想要什么,但你想将 matplotlib 图形放在 def 中,并使该命令的按钮像这样
import tkinter as tk
from tkinter import Button
root = tk.Tk()
root.geometry('300x400')
def mathplotlibgraph():
mathplotlibcode
b1 = Button(root, text = 'Mathplotlib', command = mathplotlibgraph)
b1.pack()