How to create plot of wind direction vs time

18 次查看(过去 30 天)
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 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