【发布时间】:2021-01-09 05:47:33
【问题描述】:
我用这段代码在世界地图上画了2个经纬度坐标:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
m = Basemap(projection='robin', lon_0=0, resolution='l')
lats = [24.48237852, 26.89169118]
lons = [118.1558955, 117.1760012]
m.drawcountries(color='#ffffff', linewidth=0.5)
m.fillcontinents(color='#c0c0c0', lake_color='#ffffff')
x, y = m(lons, lats)
plt.plot(x, y, 'bo', color='r', markersize=5)
plt.show()
【问题讨论】:
-
你可能想用
shapefileof china -
你能举个例子吗?
-
看看这个programmersought.com/article/82031042577如果你只想要中国地图,那么你不需要shapefile,但如果你需要州和城市坐标,那么你需要shapefile
标签: python matplotlib matplotlib-basemap