代码之家  ›  专栏  ›  技术社区  ›  Jellyse

等高线坐标

  •  0
  • Jellyse  · 技术社区  · 6 年前

    我不知道这是否可行,但我希望能够绘制给定纬度和经度的等高线。 我有一个海洋模型,它给出了在x(经度)和y(纬度)方向u和v的洋流。 使用quiver函数(quiver(x,y,u,v))和下面的代码,我成功地绘制了狮子湾的洋流图。

    Step=8 %Only use 1 in 8 data point so the arrows don't overlap too much
    figure
    q=quiver(lonu(1:Step:681,1:Step:711),latu(1:Step:681,1:Step:711),U,V,0)
    

    enter image description here

    enter image description here 资料来源:Briton,Florence,et al.“海洋环流的高分辨率建模可以揭示对生物多样性保护非常重要的保留点”,《水生保护:海洋和淡水生态系统》28.4(2018):882-893。

    问题是,当我尝试使用contour或contourf时,由于网格的选择,它完全失去了狮子湾的形状:

    figure
    contourf(sqrt(U.^2+V.^2))%The vector of the current is X=sqrt(U^2+V^2) see pythagoras
    colorbar
    

    enter image description here 所以最终,我希望能够用轮廓线来指示电流的强度,同时用箭袋来指示方向。 那么,我如何使用坐标将轮廓线给出的图片重塑为真实的图片呢? 我核对了问题 Matlab 2D contour using X-Y coordinate data

    1 回复  |  直到 6 年前
        1
  •  2
  •   Ander Biguri    6 年前

    您突然决定避免输入生成形状的数据, X Y 输入参数。

    contourf(lonu(1:Step:681,1:Step:711),latu(1:Step:681,1:Step:711),sqrt(U.^2+V.^2))%The vector of the current is X=sqrt(U^2+V^2) see pythagoras