How to add arrow to a line (like quiver)

371 views (last 30 days)
Consider I have a smple line. I want to add arrow (for example 4 arrows to this line) and show it in plot. Is it possible?
x = [0,1,2,3];
y=[ 4,4,4,4]

Accepted Answer

Sai Sri Pathuri
Sai Sri Pathuri on 28 Feb 2020
You may add marker ‘>’ to your plot. The below command plots the line with markers.
If you specify only a marker symbol without a line style (as shown below), then plot displays only the markers with no line connecting them
You may refer the following documentation to add markers
  1 Comment
Brent F
Brent F on 22 Jun 2021
This does not draw an arrowhead pointing in the direction of the line. It only adds a right-pointing triangle symbol marker at each datapoint.

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!