美文网首页
basemap画中国内地地图

basemap画中国内地地图

作者: 狼牙战士 | 来源:发表于2017-07-05 13:42 被阅读0次

    所用数据文件点击下载

    没写注释,不懂的可以加我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

    相关文章

      网友评论

          本文标题:basemap画中国内地地图

          本文链接:https://www.haomeiwen.com/subject/iqhqhxtx.html