plotting wind direction V/S time in months (timeseries)
显示 更早的评论
hi friends, i want to plot wind direction data that i have, the data is day wise and have seporate files for each year from 2007- 2013 , i have to plot in one plot....
3 个评论
Hugo
2013-6-10
I would like to help. Could you please be more specific? When you say "one plot" what do you mean: one figure with one subplot per year, or only one plot, with the vertical axis indicating angles and years simultaneously and the x axis indicating the day?
In principle, you could just plot the time series with time in the x axis (both days and years) and angles in the y axis (0-360, for example). That should be straight-forward. Most of the work will be dedicated to format the x axis labels properly. To that end you should use the properties XTick and XTickLabels, in addition to the command text. You can also make things more complicated, like plotting an arrow for each day, but please first clarify the question.
Best regards
Mitson Monteiro
2013-6-10
Mitson Monteiro
2013-6-10
回答(1 个)
Hugo
2013-6-10
Suppose you have the data in a matrix A, each row representing a measurement. The day would be in the first column and the direction of the wind in the sixth column. Then you can do:
plot(A(:,1),A(:,6));
set(gca,'YLim',[0,360]); % Range of angles
set(gca,'XTickLabel',[]);
for ind=1:size(A,1),
text(A(ind,1),-25,num2str(A(ind,1)),'Rotation',45,'VerticalAlignment','middle','HorizontalAlignment','center');
end
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!