Draw lines with arrows

版本 1.1.0.0 (2.5 KB) 作者: Sabesan
Draw lines with arrows. Multiple optional parameters are given for controlling the arrow and line
783.0 次下载
更新时间 2012/9/25

查看许可证

draw_line2 draw directional vector points in 2D with directional arrows

draw_line2(p1, p2) draw line with defulat optional parameters;
draw_line2(p1, p2 , param1, val1, ...)
The line with stretching(<-->) and compressive(>---<) arrows or without
arrows (----) can be plotted.

Input arguments:
----------------------
p1, p2 : Cordinates of the two points in 2D

Optional parameters ( passed as parameter/value pairs):
---------------

'LineColor' : Colour of line ( vector of colour or char)
default : % 'b'
'LineWidth' : Width of the line (Scaler values)
default : 5)
'ArrowDirection' : (0,1,2) (0 : p1--- p2, 1: p1 --> p2 2: and P1 <-> p2)
default : 1
'ArrowLength' : Length of the arrow ( scaler values)
default : 3
'ArrowIntend' : Intended arrow ( scaler value)
default : 1
'ArrowAngle' : Angle of arrow with the main line in degree
default : 30
'ArrowColor' : Arrow face clour ( in color vector or char)
default : 'r'
'ArrowEdgeColor : arrow edge colour ( in colour vector or char or
default : 'k'
Example:

draw_line2([0 0]', [100 100]',...
'Linecolor', 'b',...
'LineWidth', 5 ,...
'ArrowDirection, 2,...
'ArrowLength, 10,....
'ArrowIntend, 3,...
'ArrowAngle', 45,...
'ArrowColor, 'r')

will draw the line with the specified optional parameters in the current plot.

You can get the 3D version of this here.

引用格式

Sabesan (2025). Draw lines with arrows (https://www.mathworks.com/matlabcentral/fileexchange/38278-draw-lines-with-arrows), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Line without arrows also included. some bugs has been fixed.

1.0.0.0