【问题标题】:plotting image on map在地图上绘制图像
【发布时间】:2019-11-16 22:13:45
【问题描述】:

我想在底图上的特定坐标处放置一个小图像我需要做什么修改

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

【问题讨论】:

    标签: python matplotlib matplotlib-basemap


    【解决方案1】:

    下面给出你需要的相关代码sn-p,希望对你有帮助。

    # ...
    # 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()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      相关资源
      最近更新 更多