How to create plot of wind direction vs time

10 ビュー (過去 30 日間)
Munir Baldomero
Munir Baldomero 2023 年 5 月 12 日
回答済み: Anish Gupta 2023 年 5 月 21 日
Good day!
I would like to ask for help. I want to create a meteogram using matlab and I would like to know if there is someone who did a plot of wind direction vs time . I attached a sample image of what I want to do with the data.

回答 (1 件)

Anish Gupta
Anish Gupta 2023 年 5 月 21 日
Hello Munir,
As per my understanding, you want to create a plot which depicts wind direction at different time. This can be done using the "quiver" plot. For your reference, the below code demonstrates the suggested method for using “quiver” plot:
close all
figure('Position',[0 0 1000 200])
time=[0:24];%This contains your time values
a=0.75;
theta=2*pi*rand(1,25);% this contains your list of wind directions
for i=1:length(time)
quiver(time(i),0,a*cos(theta(i)),a*sin(theta(i)),'r','LineWidth',2,'MaxHeadSize',1.0)
hold on
end
xlim([min(time)-2,max(time)+2])
ylim([-2,2])
yticklabels([])
xticks(time)
For more information on “quiver” plot, please refer the following documentation link:

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by