Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在cartopy(python)中获取经度和纬度的鼠标位置_Python_Matplotlib_Event Handling_Cartopy - Fatal编程技术网

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

在cartopy(python)中获取经度和纬度的鼠标位置,python,matplotlib,event-handling,cartopy,Python,Matplotlib,Event Handling,Cartopy,我试图通过标准matplotlib事件处理使用cartopy获得鼠标位置的经度和纬度。但是当我的按钮按下事件触发时,event.x只给出图形中的像素位置(和往常一样)和event.xdata一些我无法定义的任意数字,但在180°W和180°E之间肯定没有 那么,如何在墨卡托投影中获得鼠标指针的经纬度位置呢?基本上,这回答了这个问题: Cartopy显然在使用墨卡托投影时使用了其他坐标系。当转换回PlateCarree投影时,它将“任意数”转换回lat/lon对

我试图通过标准matplotlib事件处理使用cartopy获得鼠标位置的经度和纬度。但是当我的按钮按下事件触发时,event.x只给出图形中的像素位置(和往常一样)和event.xdata一些我无法定义的任意数字,但在180°W和180°E之间肯定没有


那么,如何在墨卡托投影中获得鼠标指针的经纬度位置呢?

基本上,这回答了这个问题:

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