【发布时间】:2020-04-14 11:55:17
【问题描述】:
我想用一个小图像/图标在地图上标记某个位置(纬度、经度)。我该怎么做?
import cartopy.crs as crs
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(10, 5))
ax = plt.axes(projection=crs.PlateCarree())
ax.stock_img()
img = plt.imread('flag.png') #the image I want to add on the map
plt.show()
我在这里找到了来源:https://gist.github.com/secsilm/37db690ab9716f768d1a1e43d3f53e3f 但这对我不起作用,地图显示时没有任何标志。有没有其他方法可以做到这一点?
非常感谢!
【问题讨论】:
标签: python matplotlib cartopy