Advertisement
wbirula

Untitled

Dec 31st, 2019
1,270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. #!/usr/bin/python3
  2. from mpl_toolkits.basemap import Basemap
  3. import matplotlib.pyplot as plt
  4. import numpy as np
  5.  
  6. map = Basemap(projection='merc', lat_0 = 52, lon_0 = 19,
  7.     resolution = 'h', area_thresh = 150,
  8.     llcrnrlon=13.5, llcrnrlat=49,
  9.     urcrnrlon=24.5, urcrnrlat=55)
  10.  
  11. szerokosci = [51.3716666666667,52.3977777777778,52.0688888888889,50.6563888888889]
  12. dlugosci = [18.4352777777778,20.3091666666667,19.4794444444444,21.4527777777778]
  13. etykiety = ["Lututów","Czerwińsk n. Wisłą","Piątek","Klimontów"]
  14. x,y = map(dlugosci, szerokosci)
  15. map.plot(x, y, 'o', markersize=4, color='red')
  16.  
  17. for etykieta, xpt, ypt in zip(etykiety, x, y):
  18.     plt.text(xpt-80000, ypt+22000, etykieta,family='serif', size='8')
  19.  
  20. map.drawcoastlines()
  21. map.drawcountries(linestyle='dashed')
  22. map.fillcontinents(color = 'wheat')
  23. map.drawmapboundary(fill_color='royalblue')
  24.  
  25. plt.title("Miejscowości, które odzyskały prawa miejskie w 2020 r.")
  26. plt.savefig('mapka4miast.jpg', dpi=600)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement