37 lines
		
	
	
		
			582 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
		
		
			
		
	
	
			37 lines
		
	
	
		
			582 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| 
								 | 
							
								#!/usr/bin/env python
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import sys
							 | 
						||
| 
								 | 
							
								import fileinput
							 | 
						||
| 
								 | 
							
								import matplotlib.pyplot as plt
							 | 
						||
| 
								 | 
							
								import matplotlib.lines as lines
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								xs = []
							 | 
						||
| 
								 | 
							
								ys = []
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								for line in fileinput.input():
							 | 
						||
| 
								 | 
							
									xs.append(float(line.split(',')[0]))
							 | 
						||
| 
								 | 
							
									ys.append(float(line.split(',')[1]))
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if len(xs) == 0 or len(ys) == 0:
							 | 
						||
| 
								 | 
							
									sys.exit(1)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								xs.append(xs[0])
							 | 
						||
| 
								 | 
							
								ys.append(ys[0])
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								####
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								lineList = []
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								it = 0
							 | 
						||
| 
								 | 
							
								while it < len(xs)-1:
							 | 
						||
| 
								 | 
							
									p = plt.plot(xs[it], ys[it], "o", color = "blue")
							 | 
						||
| 
								 | 
							
									plt.annotate(it, (xs[it], ys[it]))
							 | 
						||
| 
								 | 
							
									it = it+1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								it = -1
							 | 
						||
| 
								 | 
							
								while it < len(xs)-1:
							 | 
						||
| 
								 | 
							
									plt.plot([xs[it], xs[it+1]], [ys[it], ys[it+1]], "k-")
							 | 
						||
| 
								 | 
							
									it = it+1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								plt.show()
							 |