How to create plot of wind direction vs time
8 views (last 30 days)
Show older comments
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.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1381454/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1381454/image.jpeg)
Answers (1)
Anish Gupta
on 21 May 2023
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:
0 Comments
See Also
Categories
Find more on Vector Fields in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!