New 10-line graph demo
This commit is contained in:
parent
864e1ce08f
commit
d83d8b8826
|
@ -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()
|
Loading…
Reference in New Issue