轮廓坐标
Contour coordinates
我不知道这是否可行,但我希望能够在给定的纬度和经度中绘制等高线。
我有一个海洋模型,可以在位置 x(经度)和 y(纬度)处提供方向为 u 和 v 的水流。
使用箭袋函数 (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)
可以看到,靠近海岸的模型更加细致,因为它使用了如下网格:
资料来源:英国人、佛罗伦萨等人。 "High‐resolution modelling of ocean circulation can reveal retention spots important for biodiversity conservation." 水生保护:海洋和淡水生态系统 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
所以最终,我希望能够在使用 quiver 指示方向的同时使用 contourf 指示当前的强度。 那么如何使用坐标将 contourf 给出的图片重塑为真实的东西?
我检查了问题 Matlab 2D contour using X-Y coordinate data,但我不明白如何使用建议的功能。
您突然决定避免输入给出形状的数据,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
我不知道这是否可行,但我希望能够在给定的纬度和经度中绘制等高线。 我有一个海洋模型,可以在位置 x(经度)和 y(纬度)处提供方向为 u 和 v 的水流。 使用箭袋函数 (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)
问题在于,当我尝试使用 contour 或 contourf 时,由于选择了网格,它完全失去了狮子湾的形状:
figure
contourf(sqrt(U.^2+V.^2))%The vector of the current is X=sqrt(U^2+V^2) see pythagoras
colorbar
您突然决定避免输入给出形状的数据,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