File Exchange

image thumbnail

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

version (2.54 KB) by Georg Stillfried
Draw a 3D arrow. Easily specify size, color and even transparency.


Updated 21 Sep 2009

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

Cite As

Georg Stillfried (2021). mArrow3.m - easy-to-use 3D arrow (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (27)

Patrik Drgon

Wei-Heng Hsu

Evangelos Vlachos

Exactly what I was looking for. Well done!


And what about a 3D text like in MuPad? Is it possible?

Lantao Yu

Jing Ci Neo

Works really well, but should let users control Tip Angle


Jean Darch

Just wanting to install/open the mArrow3.m application.

How to do it and is it an extension to some other application like Illustrator, PowerPoint or Blender?


Would be nice if one could fine-tune the tip width and length or tip angle. If called with output argument and without ; the return argument clutters the command window. To avoid this, and let arrow behave like plot and line, you can add at the end

if nargout == 0
clear h

xinglong fang

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.

Arne Felgentraeger


Debasis Mohapatra

Matias Gervai

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

Bahareh Ghotbi

Karl M

Matteo Costarelli

Pedro Busc


Pedro Busc



suitable for plotting the coordinate axes

Zeng Zhen

good program for arrows plot.


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

Przemyslaw Baranski

Very good!


MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Arrow3

Inspired: Spongebob Squarepants goes 3-D

Community Treasure Hunt

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

Start Hunting!