File Exchange

image thumbnail

mArrow3.m - easy-to-use 3D arrow

version 1.0 (2.54 KB) by

Draw a 3D arrow. Easily specify size, color and even transparency.



View License

This function draws a 3D arrow using a cylinder and cone patch. This allows the use of all patch properties including transparency. It can be used with default parameters (example 1) or user-defined parameters (example 2).

example 1:
> mArrow3([0 0 0],[1 1 1]);
% draws a black arrow from point [0 0 0] to point [1 1 1]

example 2:
> h = mArrow3([0 0 0],[1 1 1], 'facealpha', 0.5, 'color', 'red', 'stemWidth', 0.02);
% draws a semitransparent red arrow with a stem width of 0.02 units from point [0 0 0] to point [1 1 1]; h is the handle to the patch object

Comments and Ratings (17)

Colm O'Rourke

Yun Wang

It would be better if both the width and the length of the tip can be specifies. Also, it would be better if these could be specified relative to the length of the arrow.


Willy (view profile)

Works great —at least for simple stuff. Haven't tried doing anything fancy with it.

Karl M

Karl M (view profile)

Pedro Busc


Pedro Busc



he (view profile)

suitable for plotting the coordinate axes

Zeng Zhen

good program for arrows plot.


Felix (view profile)

Sounds good, but not working on R2011b ( No arrow, no error message.

Very good!


MATLAB Release
MATLAB 7.1.0 (R14SP3)

Inspired by: Arrow3 Version 5

Inspired: Spongebob Squarepants goes 3-D

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today