Draw direction arrows on top of wind magnitude time series.
4 views (last 30 days)
Show older comments
Hello,
Dispite several tries I cannot generate a figure like this.
I would appriciate any help.
0 Comments
Accepted Answer
Steven Lord
on 17 Jan 2019
Do you want to overlay a quiver plot on top of a regular line plot? If so, call hold on after creating the first plot but before creating the second so the first isn't erased when the second is drawn.
2 Comments
Steven Lord
on 22 Jan 2019
This sample data doesn't look so great, but hopefully it will be sufficient to illustrate the technique. x and y are the coordinates of the points on your line.
x = 1:40;
y = 3*rand(size(x));
plot(x, y, '-');
hold on;
offsetx and offsety are the lengths of the arrows in the x and y directions.
offsetx = 2*rand(size(x)) - 1;
offsety = 2*rand(size(x)) - 1;
I use the fifth input argument of quiver to disable the automatic scaling and plot the arrows going directly from the point (x(k), y(k)) to (x(k)+offsetx(k), y(k)+offsety(k)) for each k.
quiver(x, y, offsetx, offsety, 0)
More Answers (0)
See Also
Categories
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!