看板 Python 關於我們 聯絡資訊
請問,我試著以tkinter畫圖,除了畫在form上,tkinter的提供的元件中 還有哪些元件是可以被畫圖的? 我有試著把圖畫在Label內,但是好像沒有作用的樣子 from tkinter import * app = Tk() GlassFrame = Label(app,relief='groove').place(x=10,y=10, width=100,height=100) DefectFig = Canvas(GlassFrame,width=100,height=100) DefectFig.create_oval(10,10,20,20,fill='black') DefectFig.place(x=0,y=0,width=100,height=100) app.mainloop() 顯示出來的結果還是會把Label的框線蓋掉 我希望的結果是把圖畫在某個元件內,座標超出就不會被看到而已 請問上面的程式碼需要作修改嗎? 以及,用matplotlib比起tkinter會比較容易實作嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.166.104.128 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1436676361.A.A1B.html
alen332l: 純畫圖matplotlib比較容易做,是的. 07/14 09:20