91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

ArcGIS出圖有時候不好看,運用Basemap可以將shapefile加入到圖片中,出圖既美觀又方便。

資源截圖

代碼片段和文件信息

from?mpl_toolkits.basemap?import?basemap
import?matplotlib.pyplot?as?plt
import?numpy?as?np
from?matplotlib.patches?import?Polygon
from?matplotlib.collections?import?PatchCollection
from?matplotlib.patches?import?PathPatch
import?pandas?as?pd
from?dbfread?import?DBF
from?mpl_toolkits.axes_grid1.inset_locator?import?inset_axes?zoomed_inset_axes
from?mpl_toolkits.axes_grid1.inset_locator?import?mark_inset
from?adjustText?import?adjust_text
import?matplotlib.ticker?as?ticker

plt.style.use(‘boorn‘)
plt.rcParams[‘mathtext.default‘]=‘regular‘
plt.rc(‘font‘family=‘Arial‘size?=?6weight=‘bold‘)
fig?=?plt.figure(dpi=600)
ax?=?fig.add_subplot(111)

bmap?=?basemap(epsg=2380llcrnrlon=79llcrnrlat=16
???????????????urcrnrlon=139urcrnrlat=51lat_0=33.5
???????????????lon_0=109resolution=‘l‘ax=axwidth=5height=7.0*5/8)
#bmap.drawcoastlines(linewidth=0.25color=‘b‘)
bmap.drawcountries(linewidth=0.7color=‘k‘)
bmap.drawstates(linewidth=0.5color=‘r‘)
bmap.drawcounties(linewidth=0.5color=‘k‘)
bmap.drawrivers(linewidth=0.1color=‘#a6c2de‘)
bmap.drawmapboundary(fill_color=‘#a6c2de‘linewidth=0.5)
text={‘rotation‘:‘vertical‘}
bmap.drawmeridians(np.arange(7913910)labels=[0001]linewidth=0.5)
bmap.drawparallels(np.arange(165110)labels=[0100]linewidth=0.5**text)
bmap.fillcontinents(color=‘w‘lake_color=‘#a6c2de‘zorder=1)

bmap.readshapefile(‘e:/data/china_province_boundary/province‘
???????????????????‘province‘color=‘#999999‘linewidth=0.3)
patches???=?[]
for?info?shape?in?zip(bmap.province_info?bmap.province):
????patches.append(Polygon(np.array(shape)?True))
ax.add_collection(
????PatchCollection(patches?facecolor=?‘#fff8dc‘?edgecolor=‘#4F4F4F‘
????????????????????linewidths=0.5?zorder=2))

city_info?=?bmap.readshapefile(‘e:/research/NDVI_LST/data/shapefile/city30‘‘city‘)
df?=?pd.Dataframe(iter(DBF(‘e:/research/NDVI_LST/data/shapefile/city30.dbf‘)))
text={‘ha‘:‘center‘‘va‘:‘top‘}
texts=[]
for?city_info?city?in?zip(bmap.city_info?bmap.city):
????bmap.plot(city[0]?city[1]?marker=‘.‘?color=‘r‘?markersize=4?markeredgewidth=1)
????if?city_info[‘cityname‘]==‘Wuhn‘:
????????texts.append(plt.text(city[0]city[1]‘Wuhan‘

評論

共有 條評論