我想在底图上的特定坐标处放置一幅小图像,我需要做哪些修改
def base_map(temp):
fig = plt.figure(figsize=(360, 180), edgecolor='w')
m = Basemap(projection='cyl', resolution='l',
llcrnrlat=-90, urcrnrlat=90,
llcrnrlon=-180, urcrnrlon=180, )
draw_map(m)
m.bluemarble()
plt.show()
这是我想做的最终结果https://i.stack.imgur.com/XHLF6.jpg
下面提供了您需要的相关代码段,希望对您有所帮助。
# ...
# other lines of code go above
filename = "some_image.png"
lonmin, lonmax, latmin, latmax = (100.6377, 100.6447, 13.729, 13.7325) # just example
image_extent = (lonmin, lonmax, latmin, latmax)
ax = plt.gca()
ax.imshow(plt.imread(filename), extent=image_extent)
plt.show()