Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. dataAday = giveMeSelectedLines(5,2,range(7,10),'A')
  2. latlongAday = np.array([[p[0][1], p[0][0]] for p in dataAday['POLYLINE'] if len(p)>0])
  3.  
  4. bins = 1000
  5. lat_min, lat_max = 41.04961, 41.24961
  6. lon_min, lon_max = -8.71099, -8.51099
  7. # create image
  8. #bins = 513
  9. lat_bins = np.linspace(lat_min, lat_max, bins)
  10. lon_bins = np.linspace(lon_min, lon_max, bins)
  11. H2, _, _ = np.histogram2d(latlongAday[:,0], latlongAday[:,1], bins=(lat_bins, lon_bins))
  12.  
  13. img = np.log(H2[::-1, :] + 1)
  14.  
  15. plt.figure()
  16. ax = plt.subplot(1,1,1)
  17. plt.imshow(img)
  18. plt.axis('off')
  19. plt.title('Taxi trip end points (typeA2d5mfrom7to10)')
  20. plt.savefig("taxi_trip_endstypeA2d5mfrom7to10.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement