How to add arrow to a line (like quiver)
316 次查看(过去 30 天)
显示 更早的评论
Hello,
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]
plot(x,y)
Thnaks
0 个评论
采纳的回答
Sai Sri Pathuri
2020-2-28
You may add marker ‘>’ to your plot. The below command plots the line with markers.
plot(x,y,'->')
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
plot(x,y,'>')
You may refer the following documentation to add markers
2 个评论
Brent F
2021-6-22
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.
Dariusz Maton
2023-8-30
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!