在Cartopy中获取经度和纬度的鼠标位置(python)

时间:2019-12-21 12:01:05

标签: python matplotlib event-handling cartopy

我试图通过标准的matplotlib事件处理,使用cartopy获取鼠标位置的经度和纬度。但是当我的button_press_event触发时,event.x只是给出了图形中的像素位置(照常)和event.xdata一些我不能真正定义的任意数字,但是在180°W和180°E之间肯定没有任何变化。

那么我如何获得墨卡托投影中鼠标光标的经度/纬度位置?

1 个答案:

答案 0 :(得分:1)

基本上,这可以回答问题:

Obtaining coordinates in projected map using Cartopy

当使用墨卡托投影时,Cartopy显然会使用其他坐标系。当转换回PlateCarree投影时,它将“任意数”转换回经/纬对。

相关问题