How to plot wind vectors with quivers on a latitude/logitude plot

조회 수: 35 (최근 30일)
giacomo labbri
giacomo labbri 2021년 1월 16일
편집: Adam Danz 2021년 1월 20일
Hi,
I am plotting some wind data and I would like to have the that shows the direction and speed of the wind at the location were they were taken (given by latitude and longitude).
Minimal working example:
lat=[10,11,13];
lon=[-59,-58,-55];
h1=[100,100,100];
h2=[200,200,200];
u_h1=[-2,-3,-5];
u_h2=[-3,-5,-7];
v_h1=[2,1,-1];
v_h2=[2,3,-2];
w_h1=[0,0,0];
w_h2=[0,0,0];
figure
quiver3(lon,lat,h1,u_h1,v_h1,w_h1)
hold on
quiver3(lon,lat,h2,u_h1,v_h1,w_h2)
Does quiver already produce reliable length and arrow direction even if the underling grid in lat and lon. It seems so from the example but i am perplexed how does it work.
If it does not work with lat and lon as x and y how can I substitute them ratining the information about the location?
Thanks in advance

답변 (1개)

Adam Danz
Adam Danz 2021년 1월 17일
편집: Adam Danz 2021년 1월 18일
There are various types of map functions and it's not clear which one you're using. Here's a demo showing a quiver plot on a map.
About the arrow lengths, see the scale input:
  댓글 수: 2
giacomo labbri
giacomo labbri 2021년 1월 18일
Thanks for your asnwer!
I am not using any map function (unless quiver uses one by default). I am just feeding to quiver vectors that contains values of longitude and latitude as X and Y. The essence of what I am doing is in the MWE. My question is does this apprach produce reliable wind direction and lenght?
Adam Danz
Adam Danz 2021년 1월 18일
편집: Adam Danz 2021년 1월 20일
> does this apprach produce reliable wind direction and length?
Yes. By default the length of the vectors are scaled to reduce overlap. If you want the vector length to equal the magnitude of the wind velocity, set the scale to 0 as suggested in my answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by