简体   繁体   English

Plot 在 cartopy 上的轨迹尽可能短

[英]Plot trajectories on cartopy by going as short as possible

I am using cartopy in python (Robinson card) I perfectly succeeded in displaying my world map as well as my points (from an oracle database).我在 python(Robinson 卡)中使用 cartopy 我完美地展示了我的世界 map 以及我的观点(来自 oracle 数据库)。 My goal would be to connect my dots in order to make trajectories.我的目标是连接我的点以制作轨迹。 I also managed to display my trajectories but a problem arises.我还设法显示了我的轨迹,但出现了问题。 Indeed, when one of my points is on the far left of my map and the other is on the far right, my trajectory crosses my map instead of going through the "back" as it normally would on a globe.事实上,当我的一个点在我的 map 的最左边而另一个在最右边时,我的轨迹穿过我的 map 而不是像通常在地球上那样穿过“后部”。 Can you help me?你能帮助我吗?

@bricos29, Did you use transform=ccrs.Geodetic() when plotting? @bricos29,你在绘图时使用了 transform=ccrs.Geodetic() 吗? I have tried the following code, it seems work fine.我已经尝试了以下代码,它似乎工作正常。

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
ax = plt.axes(projection=ccrs.Robinson())
ax.set_global()
ax.coastlines()
plt.plot([-120, 132], [51.53, 43.17], color='red',  transform=ccrs.Geodetic())
plt.show()

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM