from tkinter import * import math okno = Tk() okno.title("Funkcje") w=500 h=500 plotno = Canvas(okno, height=h, width=w, background='white') plotno.grid(row=0,column=0) plotno.create_line(0, h/2, w, h/2) plotno.create_line(w/2, 0, w/2, h) def p(x,y): x += w/2 y = h/2 - y return x, y def f(x): return 50*math.sin(x/50) x = 100 for x in range(int(-w/2),int(w/2)): plotno.create_line(p(x, f(x)),p(x+1, f(x+1))) okno.mainloop()