basemap画中国内地地图

所用数据文件点击下载

没写注释,不懂的可以加我QQ:2544100193

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mpl_toolkits.basemap import Basemap


map = Basemap(projection='mill',
            llcrnrlat = 10,
            llcrnrlon = 72,
            urcrnrlat = 55,
            urcrnrlon = 140,
            resolution='l',area_thresh=10000)
map.drawmapboundary(fill_color='aqua')
#map.fillcontinents(color='yellow',lake_color='aqua')
map.readshapefile("CHN_adm_shp/CHN_adm1",'states',drawbounds=True)
pp = pd.read_csv("123.csv")
lat = np.array(pp["lat"])
lon = np.array(pp["lon"])
pop = np.array(pp["pop"],dtype=float)
size=(pop/np.min(pop))*5
x,y = map(lon,lat)
map.scatter(x,y,s=size)
plt.show()
basemap画中国内地地图_第1张图片
Snip20170705_1.png

你可能感兴趣的:(basemap画中国内地地图)