# 2D wave direction Plot with Arrow

26 ビュー (過去 30 日間)
Muhammad Uswah Pawara 2021 年 11 月 6 日

Dear All
I am trying to make a plot of 2D wave direction but I am not sure the script whether is it true or not,
Please give me some reference to plot the wave direction
Attached the script, data, and, result

サインインしてコメントする。

### 採用された回答

Sudharsana Iyengar 2021 年 11 月 6 日

You can use the in built quiver function which is in Matlab. For instance when you want to plot the wind direction in a given region, you can use quiver function.
What quiver does is, it takes 4 arguments. X,Y is the postions and then U and V which are the x and y component of what ever physical parameter you want to study about. For more details. https://in.mathworks.com/help/matlab/ref/quiver.html
The M map tool box by the https://www.eoas.ubc.ca/~rich/map.html contains there own scripts which will add the maps to the plot.
I hope this helps. I dont have M map tool box. I just used Matlab's quiver function to get this figure attached below.
[lat,lon]=meshgrid(-60:2:0,20:2:134);
u=sind(D/6);
v=cosd((D)/6);
%m_proj('oblique','lat',[12 -60],'lon',[60 160],'aspect',.8);
%m_coast('patch',[.9 .9 .9],'edgecolor','none');
%m_grid('tickdir','out','yaxislocation','right',...
%'xaxislocation','top','xlabeldir','end','ticklen',.02);
hold on;
quiver(lon,lat,u,v); % note I have used quiver function.
xlabel('wave direction');
##### 1 件のコメント表示非表示 なし
Muhammad Uswah Pawara 2021 年 11 月 7 日
Thank you for very detailed explanation

サインインしてコメントする。

### Community Treasure Hunt

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

Start Hunting!

Translated by