没写注释,不懂的可以加我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()
Snip20170705_1.png
网友评论