Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def read_two_column_file(file_name):
- with open(file_name, 'r') as f_input:
- csv_input = csv.reader(f_input, delimiter=' ', skipinitialspace=True, )
- long = []
- lat = []
- for col in csv_input:
- x = float(col[0]) # converting to float
- y = float(col[1])
- long.append(x)
- lat.append(y)
- return long, lat
- def display_points(long, lat):
- plt.figure()
- plt.gca().set_aspect('equal', adjustable='box')
- plt.ylabel('latitude')
- plt.xlabel('longitude')
- plt.title('longitude vs latitude')
- plt.scatter(lat, long)
- plt.orientation = u'vertical'
- plt.grid('True')
- plt.show()
- 35.905333, 14.471970
- 35.896389, 14.477780
- 35.901281, 14.518173
- 35.860491, 14.572245
- 35.807607, 14.535320
- 35.832267, 14.455894
- 35.882414, 14.373217
- 35.983794, 14.336096
- 35.974463, 14.351006
- 35.930951, 14.401137
- [2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2]
- long = np.array(long)
- lat = np.array(lat)
- plt.plot(long[path], lat[path])
Add Comment
Please, Sign In to add comment