Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dataAday = giveMeSelectedLines(5,2,range(7,10),'A')
- latlongAday = np.array([[p[0][1], p[0][0]] for p in dataAday['POLYLINE'] if len(p)>0])
- bins = 1000
- lat_min, lat_max = 41.04961, 41.24961
- lon_min, lon_max = -8.71099, -8.51099
- # create image
- #bins = 513
- lat_bins = np.linspace(lat_min, lat_max, bins)
- lon_bins = np.linspace(lon_min, lon_max, bins)
- H2, _, _ = np.histogram2d(latlongAday[:,0], latlongAday[:,1], bins=(lat_bins, lon_bins))
- img = np.log(H2[::-1, :] + 1)
- plt.figure()
- ax = plt.subplot(1,1,1)
- plt.imshow(img)
- plt.axis('off')
- plt.title('Taxi trip end points (typeA2d5mfrom7to10)')
- plt.savefig("taxi_trip_endstypeA2d5mfrom7to10.png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement