New 10-line graph demo

This commit is contained in:
MikeTheWatchGuy 2018-09-21 00:45:21 -04:00
parent 864e1ce08f
commit d83d8b8826
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import math
import PySimpleGUI as sg
layout = [[sg.Graph(canvas_size=(400, 400), graph_bottom_left=(-100,-100), graph_top_right=(100,100), background_color='white', key='graph')],]
form = sg.FlexForm('Graph of Sine Function').Layout(layout)
form.Finalize()
graph = form.FindElement('graph')
for x in range(-100,100):
y = math.sin(x/20)*50
graph.DrawPoint((x,y))
button, values = form.Read()