且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Cartopy:无法绘制具有不确定性(和相关问题)的向量场

更新时间:2023-02-06 23:39:26

关于这个的困难部分是 matplotlib 部分.如果我试图做到这一点,我会先专注于它,然后再让它在 Cartopy 中工作.从技术上讲,您需要的点位于 quiver 命令生成的路径集中的某个位置(位于 MWE 中的 q._paths 中).一个更简单的解决方案是使用 pivot='tip',这样箭头的点总是位于 (x,y) 点.

Well the hard part about this is the matplotlib part. If I were trying to make this, I'd focus on that before making it work in Cartopy. Technically, the point you need is somewhere in the set of paths generated by the quiver command (located in q._paths in your MWE). A simpler solution would be to use pivot='tip' so that the point of the arrow is always located at the (x,y) point.

当您尝试使用 Geodetic 时,您从 Cartopy 得到的错误是因为在球体上工作时正确执行所有操作涉及更复杂的数学 - 因此并非所有内容都适用于 Geodetic代码>.如果您改为使用 PlateCarree,它会将 lon/lat 视为平面上的笛卡尔坐标.

The error you're getting from Cartopy when you try to use Geodetic is because doing everying correctly when working on a sphere involves more complicated math--thus not everything works with Geodetic. If instead you use PlateCarree, it will treat lon/lat as Cartesian coordinates on a plane.