Feather and quiver not displaying data properly.
Show older comments
Hi,
I have been having trouble using feather (and quiver) plots to display wind direction.
Basically I have hourly summaries of wind direction (0-360) and I am plotting them for each hour. I have them plotted but the arrows are not-corresponding to the proper position. i.e. an arrow pointing to north (0) is not pointing completely vertical as it should, and all angles appear to be off. I've tried many ways of manipulating to solve this issue but nothing has worked. I noticed compass plots have 0 along the x axis which might be related. But with compass you are able to use 'view' to change orientation...that does not appear to work for feather plots.
Here is my code at the moment:
winddirvector=numericvalues(:,7);
ffeather=figure;
p1=subplot(2,1,1);
theta=winddirvector*pi/180;
r=2*ones(size(winddirvector));
[u,v]=pol2cart(theta,r);
wdvp=feather(u,v);
I've tried changing wdvp to feather(sin(u), cos(u)) and it made the arrows point closer but still not accurate direction. I feel there are some math/geometry issues I am missing.
Any help is appreciated as a new MATLAB user.
5 Comments
Image Analyst
on 7 Apr 2013
Please add a few lines to your script to create some sample data for "numericvalues" to illustrate your problem so we can replicate it.
Steve
on 8 Apr 2013
Edited: Image Analyst
on 8 Apr 2013
Image Analyst
on 8 Apr 2013
Edited: Image Analyst
on 8 Apr 2013
It would have been helpful if you had given us code. I guess you want us to develop it ourselves, so that we can try to help you. So, would this code work (in case anyone is still interested in trying):
winddirvector = randi(360,20,1)
(See how not giving us code wastes time - I may not have time to help you now until tomorrow, whereas with code I might have done something now. But there are others here who might have time tonight.)
Steve
on 8 Apr 2013
Steve
on 8 Apr 2013
Answers (0)
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!