Step size refuses to change. Small updates to plot size.
This commit is contained in:
		
					parent
					
						
							
								d34d6d1ba1
							
						
					
				
			
			
				commit
				
					
						015263ab1f
					
				
			
		
					 2 changed files with 18 additions and 15 deletions
				
			
		|  | @ -3,27 +3,27 @@ | |||
| <interface> | ||||
|   <requires lib="gtk+" version="3.24"/> | ||||
|   <object class="GtkAdjustment" id="bigRadiusAdjustment"> | ||||
|     <property name="lower">0.10</property> | ||||
|     <property name="lower">0.5</property> | ||||
|     <property name="upper">100</property> | ||||
|     <property name="value">0.10</property> | ||||
|     <property name="step-increment">0.10</property> | ||||
|     <property name="page-increment">1</property> | ||||
|     <property name="value">0.5</property> | ||||
|     <property name="step-increment">0.5</property> | ||||
|     <property name="page-increment">5</property> | ||||
|     <signal name="value-changed" handler="bigRadiusAdjustment_value_changed_cb" swapped="no"/> | ||||
|   </object> | ||||
|   <object class="GtkAdjustment" id="distanceAdjustment"> | ||||
|     <property name="lower">0.10</property> | ||||
|     <property name="lower">0.5</property> | ||||
|     <property name="upper">100</property> | ||||
|     <property name="value">0.10</property> | ||||
|     <property name="step-increment">0.10</property> | ||||
|     <property name="page-increment">1</property> | ||||
|     <property name="value">0.5</property> | ||||
|     <property name="step-increment">0.5</property> | ||||
|     <property name="page-increment">5</property> | ||||
|     <signal name="value-changed" handler="distanceAdjustment_value_changed_cb" swapped="no"/> | ||||
|   </object> | ||||
|   <object class="GtkAdjustment" id="smallRadiusAdjustment"> | ||||
|     <property name="lower">0.10</property> | ||||
|     <property name="lower">0.5</property> | ||||
|     <property name="upper">100</property> | ||||
|     <property name="value">0.10</property> | ||||
|     <property name="step-increment">0.10</property> | ||||
|     <property name="page-increment">1</property> | ||||
|     <property name="value">0.5</property> | ||||
|     <property name="step-increment">0.5</property> | ||||
|     <property name="page-increment">5</property> | ||||
|     <signal name="value-changed" handler="smallRadiusAdjustment_value_changed_cb" swapped="no"/> | ||||
|   </object> | ||||
|   <object class="GtkWindow" id="spWindow"> | ||||
|  |  | |||
|  | @ -28,15 +28,18 @@ class spirographs: | |||
|         bigRadiusAdjustment = builder.get_object('bigRadiusAdjustment') | ||||
|         smallRadiusAdjustment = builder.get_object('smallRadiusAdjustment') | ||||
|         distanceAdjustment = builder.get_object('distanceAdjustment') | ||||
|         # set the initial values to a neat shape | ||||
|         bigRadiusAdjustment.set_value(self.bigRadius) | ||||
|         smallRadiusAdjustment.set_value(self.smallRadius) | ||||
|         distanceAdjustment.set_value(self.distance) | ||||
|         # try and set the step size?! | ||||
|         bigRadiusAdjustment.set_step_increment(0.5) | ||||
|         smallRadiusAdjustment.set_step_increment(0.5) | ||||
|         distanceAdjustment.set_step_increment(0.5) | ||||
|         # create initial plot | ||||
|         self.recalcPoints() | ||||
|         self.showPlot() | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     def calcEpiX(self, theta): | ||||
|         return ((self.bigRadius + self.smallRadius) * math.cos(theta)) - (self.distance * math.cos(((self.bigRadius + self.smallRadius)/(self.smallRadius))*theta)) | ||||
| 
 | ||||
|  | @ -76,7 +79,7 @@ class spirographs: | |||
| 
 | ||||
|     def showPlot(self): | ||||
|         viewport = builder.get_object('plotViewport') | ||||
|         self.plotFigure = Figure(figsize=(5, 4), dpi=100) | ||||
|         self.plotFigure = Figure(figsize=(5, 5), dpi=100) | ||||
|         self.epiPlot, self.hypoPlot = self.plotFigure.subplots(1, 2) | ||||
|         self.epiPlot.set_title(f"Epichondroid of {self.bigRadius}, {self.smallRadius}, {self.distance}") | ||||
|         self.epiPlot.plot(self.epiX, self.epiY) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue