Clear Filters
Clear Filters

Put arrows on a continuous line plot to show direction of evolution

144 views (last 30 days)
Hello everybody
What I am trying to do is yo show, through, for example, the quiver function, the direction of evolution of my data points. My data point is given in the following file, "Quiver_Data.txt". Since I would like the arrowhead to appear every certain number of elements in the arrays due to the density of points, I have tried this approach in line with what is exposed in this post: Is it possible to connect points on a scatter plot with arrows instead of a line?
hold on
However, the result is far from being the desired one, as you can see when plotting that.
Any ideas?

Answers (1)

KSSV on 22 Jul 2021
Edited: KSSV on 23 Jul 2021
Try this:
data = importdata('Quiver_Data.txt') ;
x = data(:,1) ;
y = data(:,2) ;
dx = gradient(x) ;
dy = gradient(y) ;


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!