Add convenience function to draw frame
This commit is contained in:
		
							parent
							
								
									ccee6134bb
								
							
						
					
					
						commit
						6047017551
					
				
					 1 changed files with 12 additions and 1 deletions
				
			
		
							
								
								
									
										11
									
								
								lib/plot.py
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								lib/plot.py
									
										
									
									
									
								
							|  | @ -153,6 +153,13 @@ class Plotter: | ||||||
|         self.pen_down = True |         self.pen_down = True | ||||||
|         self.position = point |         self.position = point | ||||||
| 
 | 
 | ||||||
|  |     def draw_frame(self): | ||||||
|  |         self.move_to(self.paper.bottom_left()) | ||||||
|  |         self.line_to(self.paper.bottom_right()) | ||||||
|  |         self.line_to(self.paper.top_right()) | ||||||
|  |         self.line_to(self.paper.top_left()) | ||||||
|  |         self.line_to(self.paper.bottom_left()) | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| class SVGPlotter(Plotter): | class SVGPlotter(Plotter): | ||||||
| 
 | 
 | ||||||
|  | @ -291,3 +298,7 @@ class MultiPlotter(Plotter): | ||||||
| 
 | 
 | ||||||
|     def register_plotter(self, plotter): |     def register_plotter(self, plotter): | ||||||
|         self.plotters.append(plotter) |         self.plotters.append(plotter) | ||||||
|  | 
 | ||||||
|  |     @property | ||||||
|  |     def paper(self): | ||||||
|  |         return self.plotters[0].paper | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue