SHARE
TWEET

Untitled

a guest Jan 11th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from mpl_toolkits.basemap import Basemap
  2. import matplotlib.pyplot as plt
  3. import numpy as np
  4.  
  5. my_map = Basemap(projection='mill', lat_0 = 57, lon_0 = -135,
  6.     resolution = 'h', area_thresh = 0.1,
  7.     llcrnrlon=-136.25, llcrnrlat=56.0,
  8.     urcrnrlon=-134.25, urcrnrlat=57.75)
  9.  
  10. my_map.drawcoastlines()
  11. my_map.drawcountries()
  12. my_map.fillcontinents(color = 'purple')
  13. my_map.drawmapboundary()
  14.  
  15. lons = [-135.3318, -134.8331, -134.6572]
  16. lats = [57.0799, 57.0894, 56.2399]
  17. x,y = my_map(lons, lats)
  18. my_map.plot(x, y, 'bo', markersize=10)
  19.  
  20. labels = ['Sitka', 'Baranof\n  Warm Springs', 'Port Alexander']
  21. x_offsets = [10000, -20000, -25000]
  22. y_offsets = [5000, -50000, -35000]
  23.  
  24. for label, xpt, ypt, x_offset, y_offset in zip(labels, x, y, x_offsets, y_offsets):
  25.     plt.text(xpt+x_offset, ypt+y_offset, label)
  26.  
  27. plt.show()
  28.  
  29. print "I changed the projection to mill and changed the fill contients to the colo purple"
RAW Paste Data
Top