arrowHead

Version 1.0.0 (2.32 KB) by Florian
Draws stealth arrows at given coordinates.
8 Downloads
Updated 13 May 2025

View License

ARROWHEAD draws stealth arrows at given coordinates.
ARROWHEAD(X,Y) plots an arrow head at coordinates specified by X and Y.
ARROWHEAD(...,Name,Value) plots an arrow head with properties specified by name-value pairs.
P=ARROWHEAD(...) returns an object generated by Matlab's `patch` function.
Possible names are
- FaceColor : any input that is valid for Matlab's `patch` function,
- FaceAlpha : any input that is valid for Matlab's `patch` function,
- EdgeColor : any input that is valid for Matlab's `patch` function,
- LineStyle : any input that is valid for Matlab's `patch` function,
- ArrHeadLen: any real value, specifies length of arrow head, measured from stealth notch to tip
- ArrHeadWid: any real value, specifies width of arrow head
- Anchor : any real value or "stealth", controlling the alignment of the arrow head and coordinate [x, y],
if "stealth", then [x, y] aligns with the stealth notch,
if 1, then [x, y] aligns with the arrowhead's tip,
if 0, then [x, y] aligns with the midpoint between the two non-tip nodes,
if any other value, [x, y] aligns with the inter-/extrapolation of the above two points,
- Rotation : any real value, specifies the counterclockwise rotation in degree
- Axes : axes to which the arrow head should be added
Examples of use:
figure, hold on, grid on, daspect([1, 1, 1])
plot( 0, 0, 'rx'), arrowHead( 0, 0);
plot( 2, 0, 'rx'), arrowHead( 2, 0, Stealth=0.2);
plot( 4, 0, 'rx'), arrowHead( 4, 0, Stealth=0.2, Anchor=0);
plot( 6, 0, 'rx'), arrowHead( 6, 0, Stealth=0.2, Anchor=1);
plot( 8, 0, 'rx'), arrowHead( 8, 0, Stealth=0.2, Anchor="stealth");
plot(10, 0, 'rx'), arrowHead(10, 0, FaceColor='b', FaceAlpha=0.3, EdgeColor='g', LineStyle='-.');
plot(12, 0, 'rx'), arrowHead(12, 0, ArrHeadLen=1.5, ArrHeadWid=0.5);
plot(14, 0, 'rx'), arrowHead(14, 0, Rotation=135, Stealth=0.2);
arrowHead(16, 0, Rotation=35, Stealth=0.2, FaceColor=[0.8, 0, 0], EdgeColor="none", ArrHeadWid=0.8);
MATLAB Release Compatibility
Created with R2024a
Compatible with R2021a and later releases
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0