New 10-line graph demo
This commit is contained in:
		
							parent
							
								
									864e1ce08f
								
							
						
					
					
						commit
						d83d8b8826
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								Demo_Graph_Element_Sine_Wave.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Demo_Graph_Element_Sine_Wave.py
									
										
									
									
									
										Normal 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() | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue