반응형
/*******************************************************************************************************************
-- Title : [Py3.5] Basemap Customization w/ Matplotlib
-- Reference : pythonprogramming.net
-- Key word : python 파이썬 matplotlib basemap pyplot 해안선 국경선 llcrnrlat llcrnrlon urcrnrlat urcrnrlon
해상도 resolution etopo bluemarble
*******************************************************************************************************************/
-- Figure
-- Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt # ------------------------------ # -- 특정 영역 확대하기 # ------------------------------ m = Basemap(projection='mill', llcrnrlat = -40, llcrnrlon = -40, urcrnrlat = 50, urcrnrlon = 75) ''' llcrnrlat - lower left corner latitude llcrnrlon - lower left corner longitude urcrnrlat - upper right corner latitude urcrnrlon - upper right corner longitude ''' # -- 해안선 표기 m.drawcoastlines() plt.show() # ------------------------------ # -- 특정 영역 확대하기 # ------------------------------ m2 = Basemap(projection='mill', llcrnrlat = -90, llcrnrlon = -180, urcrnrlat = 90, urcrnrlon = 180) m2.drawcoastlines() # 해안선 표기 m2.drawcountries(linewidth=2) # 국경선 표기 m2.drawstates(color='b') # State선 표기 m2.drawcounties(color='darkred') # Count 색채움 plt.title('Basemap Tutorial') plt.show() # ------------------------------ # -- 해상도 처리(에러 난당) # ------------------------------ m3 = Basemap(width=12000000, height=9000000, projection='lcc', resolution='l', lat_1=45., lat_2=55, lat_0=50, lon_0=-107.) ''' resultion parameter: c - crude l - low h - high f - full ''' #m3.etopo() m3.bluemarble() plt.show() | cs |
반응형