View License

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

» Watch video

Highlights from

4.5 | 120 ratings Rate this file 399 Downloads (last 30 days) File Size: 58.2 KB File ID: #278 Version: 2.1
image thumbnail




14 Jan 2000 (Updated )

Draw a line with an arrowhead.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Popular File 2012 2013

| Watch this File

File Information

ARROW (5/25/2016) Draw a line with an arrowhead.
ARROW(Start,Stop) draws a line with an arrow from Start to Stop (points should be vectors of length 2 or 3, or matrices with 2 or 3 columns), and returns the graphics handle of the arrow(s). By itself, ARROW will use the mouse to allow selection.
ARROW DEMO & ARROW DEMO2 show 3-D & 2-D demos of the capabilities of ARROW.
ARROW PROPERTIES shows the properties that can be set (length, base angle, tip angle, width, which ends have arrowheads, etc.)


This file inspired The Carpetplot Class, Ogive Optimization Toolbox, Random Boolean Network Toolbox, Quiver2.M V1.2 (Nov 2009), Optica.Zip, Draw, Arrowflow, and Evenly Spaced Streamlines.

MATLAB release MATLAB 9.0 (R2016a)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (152)
06 Feb 2017 Yiming Pan

Awesome work!

31 Jan 2017 Michael

24 Jan 2017 gusjammo

Fantastically good.

23 Jan 2017 Yuki Hayashi


16 Jan 2017 Baoning Wu

With perfect control of properties, this is exactly what I want!

05 Dec 2016 Miguel Angel Jiménez Herrera

29 Oct 2016 Jing Lou

Jing Lou (view profile)

Nice work!

25 Oct 2016 Mohammed

Nice Job! Works well with my oldest version of MATLAB.

Here is my line of the code:

Both tStart an tStop are numerical parameters and pre-defined.

29 Aug 2016 Jose María Morales de Francisco

01 Aug 2016 Rick

Rick (view profile)

19 Jul 2016 quan yuan

09 Jun 2016 Erik Johnson

Daisuke, I've not seen this problem before. What version of MATLAB? Can you give a minimal working example to demonstrate it?

Comment only
08 Jun 2016 Daisuke

When I drew a vertical arrow, the line got off from the arrow head (see the url for a picture). Is there a way to fix this? If not, could you tell me how I could adjust this ?

Comment only
25 May 2016 Erik Johnson

After a long hiatus, arrow has been updated for HG2 compatibility. I _think_ most of the comments below have been incorporated.

Comment only
23 May 2016 easywei

What's going on with this error:

views = get(ax(:),{'View'});

Error in arrow (line 961)
mask = arrow_is2DXY(oldaxlims(:,1));

Thanks anyone!

Comment only
21 May 2016 Matthew Gruber

Works well on (R2015b) after putting in the exact changes that Johannes recommends (2 posts down). Before that it didn't work on my version but did on other matlab installs I have at school etc., getting the same error people are talking about.

14 May 2016 Ken

Ken (view profile)

Ooops, my bad. You must implement all of the suggestions by Justin and Brenton.

Comment only
05 Feb 2016 Johannes

For everybody that has problems running the current arrow.m version on newer Matlab versions, please follow the corrections suggested by Justin and Brenton from 11 Nov 2014. I adapted them on Matalb R2015a and it works....

Here the suggested changes copied from their posts:

Previous: Line 423 ax = o * gca;
Update: ax = repmat(gca,narrows,1);

Previous: Line 590 curT = get(curax,'Xform');
Update: [azA,elA] = view(curax);
curT = viewmtx(azA,elA);

Brenton: Piggy-backing on Justin's edits, update with the following:

LINE 504: oldaxlims(min(find(oldaxlims(:,1)==0)),:) = [ii reshape(axl',1,6)];

LINE 960:
lims = get(ax(oldaxlims(:,1)),{'XLim','YLim','ZLim'})';

LINE 962:
mask = arrow_is2DXY(ax(oldaxlims(:,1)));

Comment only
26 Jan 2016 Amir Paster

It doesn't work in Matlab 2015a

>> arrow
Undefined operator '*' for input arguments of type ''.

Error in arrow (line 423)
ax = o * gca;

20 Jan 2016 ankit dixit

ankit dixit (view profile)

01 Dec 2015 Moses

Moses (view profile)

Thanks Justin and Brenton! I got it to work for MatLAB version 2015b following your edits.

Comment only
19 Oct 2015 Leonard Wayne

As an alternative, there is now the DaVinci Draw toolbox,, which uses low-level Matlab commands like plot() and patch() to draw mid-level shapes like arrows. Example syntax:

davinci( 'arrow', 'X', [0 10], ...
'Y', [0 2], ...
'Shaft.Type', 'rectangle', ...
'Shaft.Width', 1, ...
'Head.Length', 2.5, ...
'Color', 'w', ...
'EdgeColor', 'k', ...
'LineWidth', 2.5 )

28 Sep 2015 Johannes

Same here in 2015b, not working properly
>> arrow DEMO
Undefined operator '*' for input arguments of type ''.

Error in arrow (line 423)
ax = o * gca;

Error in arrow>arrow_demo3 (line 1273)
h1 = feval(mfilename,[axlim(1) axlim(4) 4],[-.8 1.2 4], ...

Error in arrow (line 142)

Comment only
17 Sep 2015 David MERCIER

12 Sep 2015 Zhigang Xu

Zhigang Xu (view profile)

Dear Author,

It seems that the ARROW cannot work with Matlab R2015a version. I got an error message as

Error in arrow (line 406)
ax = o * gca;

Can you fix it? Thanks!


Comment only
25 Aug 2015 Andrew Boysen

Thank you Daniel Claes - that worked for me!

16 Jun 2015 Daniel Claes

It is not mine, but I found a working version it on GitHub (works for 2015a):

31 May 2015 Mohamed Abdelkader Zahana

Good contribution. Thanks!

16 May 2015 Jakob Sievers

Jakob Sievers (view profile)

Thank you for the preceeding comments. They helped making this otherwise excellent function work. 5 stars for the function. 0 stars for the slow updating. I strongly encourage the author update this function according to the comments made.

08 May 2015 Min-Chi Shih

Thanks to Justin A., Brenton, and Bruce Elliott, I have got it to work as well (R2014b). This is much better than the built-in annotation.m.

01 May 2015 Rachael Hardman

Thank you for the comments - I've got it to work now too.

01 May 2015 Erik

Erik (view profile)

Thanks to the comments of Justin A., Brenton and Bruce Elliott, I got this fantastic file working for the arrows I needed in MATLAB R2014b. Author: please update this file to make it compatible with the new graphics system.

16 Dec 2014 Barbara

Barbara (view profile)

27 Nov 2014 Eli

Eli (view profile)

did anyone manage to make
arrow DEMO
work with 2014b? would it be possible to upload an updated working version?

Comment only
19 Nov 2014 Bruce Elliott

Thanks to Justin and Brenton for the recommended mods for R2014b. I have another set of related changes.

These changes will suppress warnings about use of the graphics object property "EraseMode", which is no longer used. I believe the only purpose of these lines was to temporarily change the EraseMode and then to reset it to its original value.

REMOVE LINES 1031, 1032, 1033, 1065:

oldArrowProps = {'EraseMode'};
oldArrowValue = get(H,oldArrowProps);
set(H,'EraseMode','background'); %because 'xor' makes shaft invisible unless Width>1


Comment only
11 Nov 2014 Brenton

Piggy-backing on Justin's edits, update with the following:

LINE 504: oldaxlims(min(find(oldaxlims(:,1)==0)),:) = [ii reshape(axl',1,6)];

LINE 960:
lims = get(ax(oldaxlims(:,1)),{'XLim','YLim','ZLim'})';

LINE 962:
mask = arrow_is2DXY(ax(oldaxlims(:,1)));

Comment only
11 Nov 2014 Justin A.

Strike that. It works for one arrow, but not the demo.

Comment only
11 Nov 2014 Justin A.

I was able to get it to work in 2014b with 2 changes:

Previous: Line 423 ax = o * gca;
Update: ax = repmat(gca,narrows,1);

Previous: Line 590 curT = get(curax,'Xform');
Update: [azA,elA] = view(curax);
curT = viewmtx(azA,elA);

Comment only
29 Oct 2014 Yang Liu

@David, @Tobias, I have encountered the same issue.
Did you manage to resolve the problem? Thanks in advance!

Comment only
21 Oct 2014 David

David (view profile)

Love this script, but it looks like there's a fundamental incompatibility with the new 2014b graphics system, in which gca no longer returns a number. Simply running the demo (arrow DEMO) returns the error:

Undefined function 'mtimes' for input arguments of type
Error in arrow (line 423)
ax = o * gca;

Comment only
24 Sep 2014 Liviu Ivanescu

Nice function, but unfortunately it doesn't accept axes handle, like plot. In same cases, like Maltab GUI, one cannot just set the axes before making the plot.

Comment only
15 Sep 2014 Pete

Pete (view profile)

I was a bit sceptical, but this is actually a very useful and well-documented function. Many thanks

21 Aug 2014 Darien

Darien (view profile)

You are brilliant. Thank you very much for your hard work and masterful technique.

22 Jul 2014 Johan

Johan (view profile)

Works nicely, but i did find a bug:
an exactly vertical arrow (from [0 0 0] to [0 0 1]) is plotted with a length of ~16 reaching far in the negative z-domain. Just type in
arrow([0 0 0],[0 0 1])
and see.

Does someone know a solution to this?

with kind regards,

16 Jul 2014 Peter Caday

@Li, after reading Rajib's comment below, I saw you can change color in one function call:

h = arrow(..., 'EdgeColor', 'g', 'FaceColor', 'g');

@Tobias, I don't have 2014b, but you could try replacing line 423 with:

ax = repmat(o, narrows, 1);

Comment only
10 Jul 2014 Tobias Benjamin Gram

After updating Matlab to 2014b, arrow.m is not working. It is stopping in line 423 with the error:

Undefined function 'mtimes' for input arguments of type ''.

Error in arrow (line 423)
ax = o * gca;

Can somebody please help me?

Comment only
11 Jun 2014 Simon Angus

Terrific. Thanks.
For those of you who would like to have a small gap between the arrow and the start and end point (e.g. so as not to obscure a marker), I've written a slight update (note: not compatible with arrow.m properties directly, but you could easily adapt):

function [varargout] = my_arrow(start,stop)
arrow_gap_pc = 0.05; % defines gap size relative to size of initial arrow
[th,phi,r] = cart2sph(dx,dy,dz);
arrow_gap = arrow_gap_pc*r;
[x1,y1,z1] = sph2cart(th,phi,arrow_gap);
b = start+[x1 y1 z1];
e = stop-[x1 y1 z1];
ah = arrow(b,e);
if nargout == 1
varargout{1} = ah; end

04 Mar 2014 Pegah Hosseini

I think this is one of the best functions I have ever stumbled upon. Thanks alot.

05 Feb 2014 Yagiz

Yagiz (view profile)

08 Jan 2014 Li Zhang

Useful! How to change the color of the arrow ?

17 Oct 2013 Alan

Alan (view profile)

13 Aug 2013 ammar al jodah

11 Jul 2013 Harish Babu Kankanala

30 May 2013 Alexandros Iliopoulos

02 May 2013 Jo Williams

Very useful, thanks. The help suggests using AXIS(AXIS) to fix the limits, I think the same effect can be acheived with AXIS MANUAL, which would be clearer.
It's also not obvious that the arrow will be a patch object, so has properties like edgecolor, facecolor, rather than line properties.

30 Mar 2013 Jan Motl

Jan Motl (view profile)

07 Mar 2013 Jan Valdman

Jan Valdman (view profile)


11 Feb 2013 Sisi Ma

Sisi Ma (view profile)

10 Feb 2013 Rajib Mozumder

I wrote the following code:

hold on;
Z1 = 500;
arrow([max(X) max(Y) Z1],[min(X) min(Y) Z1],15,'BaseAngle',60, 'FaceColor',[0 1 0])

I want to make outputs (which must contain the line along with arrow head) in X-Z plane; i.e. view([180 0]), not in 3D which is good for visualization only. Unfortunately, though the line is visible, the arrow head is not seen when I go into 2D view. I tried to include 'CrossDir',[0 0 1] as suggested by the author of the script, but it didn't help. Any suggestion?

20 Jan 2013 Michael Chan

Michael Chan (view profile)

How do you turn off the arrow heads at either ends of the start and stop points?

Comment only
17 Jan 2013 Matthew M.

Very helpful and thorough! I only have a couple of minor quibbles - 1) the author didn't make it totally clear what normal MATLAB line properties you should use to change the arrow color and arrowhead color. But it's not too hard to figure out. 2) The author didn't assign message identifiers to the warnings (like for changing the axis limits). I edited the function to add message identifiers so I could turn them off - don't need my Command Window cluttered up with a lot of orange text.

12 Dec 2012 Haochen Tang

11 Oct 2012 Ryan

Ryan (view profile)

Does anyone know how to add an arrow to the legend? I'm using arrow.m to draw arrows which represent data on the plot and it would be helpful to have a blue arrow in the legend.

11 Jun 2012 Kent Leung

@Matthias, I had this problem too and just stumbled on a solution. (In fact, the problem for me was that the xlabel was disappearing.) To fix this I did:

ax1=subplot(2,1,1); [...]
axes(ax1); arrow([x1 y1],[x2 y2]); arrow fixlimits;

I always do "fixlimits" just in case. The reason I tried this was because in the help file:
"You may want to execute AXIS(AXIS) before calling arrow so it doesn't change the axes on you; arrow determines the sizes of arrow components BEFORE the arrow is plotted, so if arrow changes axis limits, arrows may be malformed."

It's not obvious that this fixed the subplot resizing problem, but it worked!

30 May 2012 Felix

Felix (view profile)

By far the easiest way to draw arrow compared with arrow3.m and mArrow3.m.

14 May 2012 Jiangmin zhang

07 May 2012 Matthias Hunstig

Generally works fine. However, I use subplots, e. g. 3 x 2, and some of them have arrows. Now the arrows change the size of the subplot so that the subplots are no longer of equal size. Any idea how to correct that?

01 Apr 2012 ATN

ATN (view profile)

How do I make the arrows dashed, and make the color for each arrow different, corresponding to its z value?

Adding the 'Linestyle',':' for dashed line option makes the arrows look rather strange.

For the colors, I tried creating an nx3 matrix lineColors where each row is a color for the corresponding element, and added the option " 'EdgeColor',lineColors ", but got an error:

"Color value must be a 3 element numeric vector"

Any help is appreciated. Thanks.

Comment only
16 Mar 2012 Yuanye Wang

Yuanye Wang (view profile)

exactly what I need. thanks a lot.

14 Feb 2012 Tobias

Tobias (view profile)

Regarding W & Jacopo,

setting the view before the arrow functions solves your problem e.g.:

clc; clear; close all

xvector=[1 0 0];
yvector=[0 1 0];
zvector=[0 0 1];

grid on
daspect([1 1 1])
xlabel('x [mm]', 'FontWeight', 'bold')
ylabel('y [mm]', 'FontWeight', 'bold')
zlabel('z [mm]', 'FontWeight', 'bold')

%Here goes the view setting
view([1 1 1])

arrow([0 0 0],xvector, 'EdgeColor','k','FaceColor','k')
arrow([0 0 0],yvector, 'EdgeColor','b','FaceColor','b')
arrow([0 0 0],zvector, 'EdgeColor','r','FaceColor','r')

%Not here
%view([1 1 1])

Don't no why but seems to work!


Comment only
29 Dec 2011 John Colby

Wonderful. Thank you, Erik!!!

21 Dec 2011 Kuifeng

01 Sep 2011 Jacopo

Jacopo (view profile)

> Christopher This code, at least on >R2009a, looks very strange.
>close all; clc;
>axis([-1 1 -1 1 -1 1])
>I'm really having trouble with 3-D plots >and arrows pointing along the 3rd axis.

I got the same problem on Matlab R2010a (7.10.0)

Comment only
31 Aug 2011 Will

Will (view profile)

Using arrow with this script yields an unusually long arrow in the z direction, which is quite annoying. I wish the z arrow didn't become long.

clc; clear; close all

xvector=[1 0 0];
yvector=[0 1 0];
zvector=[0 0 1];

grid on
daspect([1 1 1])
xlabel('x [mm]', 'FontWeight', 'bold')
ylabel('y [mm]', 'FontWeight', 'bold')
zlabel('z [mm]', 'FontWeight', 'bold')
arrow([0 0 0],xvector, 'EdgeColor','k','FaceColor','k')
arrow([0 0 0],yvector, 'EdgeColor','b','FaceColor','b')
arrow([0 0 0],zvector, 'EdgeColor','r','FaceColor','r')
view([1 1 1])

Help would be greatly appreciated.

Comment only
19 Jul 2011 William Mische

This is great, I messed around with the annotations for 1.5 hours before finding this. Once I found it everything was working the way I wanted it to in a couple of minutes. Great Work!

Comment only
08 Jul 2011 Dmytro Lituiev

19 May 2011 Marco idiart

Perfect. Just what I was needing.

21 Apr 2011 Zhibo

Zhibo (view profile)

Very nice utility function. I just wonder if it is possible to fix the arrow head size so that it does not change with axis- zoom or resize. Thanks!

18 Mar 2011 Richard Crozier

Really useful, thanks!

18 Mar 2011 Miguel Gil-Pugliese

Thanks :)

08 Mar 2011 Arthur

Arthur (view profile)

Very nice, thanks

03 Mar 2011 guizhi

guizhi (view profile)

can this function specify the 'LineStyle', such as '-' , '--' , '-.' , and ':'?
how to do?
thank you.

16 Feb 2011 Rishabh Kasliwal

thanks a lot. I was trying to make a arrow in a gui window. was having difficulty in correctly saving the arrow location. using your code it works perfectly :)

28 Jan 2011 CC

CC (view profile)

Overall, the script is very useful. However, when using this arrow script, the legend is messed up. Some of the legend symbols would show as "black" squares instead of the correct symbol. When the arrow script is not used, the legend is displayed correctly.

02 Dec 2010 hajime yamada

Could anybody please let me know the following:

1. How to change the size of the arrow?
2. Please let me know how to change the type of the arrow head.
3. If possible, please let me know how to have arrow at both the head and tail of the vector.
4. Instead of arrow, please let me know how I can have a dot at both ends of the vector?
5. How to change the line type?


Comment only
12 Oct 2010 ben harper

can you please include the color options that you write on these comments to the code help lines
thank you

Comment only
12 Jun 2010 Jiangmin zhang


19 May 2010 Notan

Notan (view profile)

Works great, but the Arrowtips do not look perfect by default as they are the connection of two line ends and therefore not round in pdf printouts.
You can workaround this issue by drawing the arrow in the opposite direction and use parameter: 'End','start'.
But nonetheless it would be nice if they would be perfect by default ;-)

10 May 2010 David

David (view profile)


08 May 2010 Christopher

This code, at least on R2009a, looks very strange.
close all; clc;
axis([-1 1 -1 1 -1 1])

I'm really having trouble with 3-D plots and arrows pointing along the 3rd axis.

Comment only
04 May 2010 Ryan Molecke

I found this implementation to be slow and lacking. Admittedly I was drawing thousands of arrows at extremely short lengths. Here is an inline function I wrote in about 5 minutes to draw simple arrows.

function out = draw_arrow(startpoint,endpoint,headsize)
%by Ryan Molecke

v1 = headsize*(startpoint-endpoint)/2.5;

theta = 22.5*pi/180;
theta1 = -1*22.5*pi/180;
rotMatrix = [cos(theta) -sin(theta) ; sin(theta) cos(theta)];
rotMatrix1 = [cos(theta1) -sin(theta1) ; sin(theta1) cos(theta1)];

v2 = v1*rotMatrix;
v3 = v1*rotMatrix1;
x1 = endpoint;
x2 = x1 + v2;
x3 = x1 + v3;
hold on;
% below line fills the arrowhead (black)
fill([x1(1) x2(1) x3(1)],[x1(2) x2(2) x3(2)],[0 0 0]);
% below line draws line (black)
plot([startpoint(1) endpoint(1)],[startpoint(2) endpoint(2)],'linewidth',2,'color',[0 0 0]);

Comment only
17 Jan 2010 Rob Campbell

Rob Campbell (view profile)

Useful in many ways but the code is very complicated and it's not clear how to attain specific effects without trawling through the function body. Why not put demo code in a separate file?

27 Dec 2009 Aamir

Aamir (view profile)

15 Dec 2009 Aamir

Aamir (view profile)

10 Nov 2009 Lorenzo Guerrasio

It looks really great...I'll start use instead of quiver!

07 Oct 2009 never change

amazing,very useful

20 Jul 2009 Gabriel Akira Schreiber

The arrowheads look distorted. Even the arrowheads in the demo look distorted.

16 Jun 2009 Jianbo

Jianbo (view profile)

Excellent. One little problem is that the arrow created is a little different from the one inserted manually through the "insert" menu. For example, the position can not be adjust by mouse.

10 Feb 2009 Hiram

Hiram (view profile)

to set the color of the arrow, see this example:
axis([0 3 0 3 0 3]);
grid on
h=arrow([3 3 3],[0 0 0],36,'BaseAngle',60);
set(h, 'FaceColor', 'b');
set(h, 'EdgeColor', 'r');
Awesome application!

30 Jan 2009 Ke

Ke (view profile)

very useful.

29 Aug 2008 Saeed Taherion

16 Aug 2008 Leonardo Duarte

15 Jul 2008 lili kalmer

02 Jul 2008 Joselito Dimayuga

the purpose of this Dir or format is for ?????

25 Jun 2008 Dmitry Vasilyev

OMG! Just exactly what I was looking for! Excellent job, thank you Eric!

10 Jun 2008 GDR! x

One can change the colour of an arrow by specifying 'FaceColor' and 'EdgeColor' properties, which is, unfortunately, not documented.

22 May 2008 Xuzhang Shen


Comment only
27 Apr 2008 Alex Fard

04 Feb 2008 Matthijs Klomp

Works great.

31 Oct 2007 Tuan Hoang

sorry, how to add this graphic handle (return value) to an existing axes, figure.

24 Oct 2007 Ahmet Sacan

Does not work when called in a deployed application (i.e., when called from the executable generated using mcc).

Comment only
09 Oct 2007 Rutty Bee

Ruins the figure when plotting 3-D arrows with z-components. In this case, the width of the arrowhead becomes so large that the plot is rendered unusable. This is the case no matter how one tries to set its size.

04 Oct 2007 Dustin Kruse

works perfectly

08 Aug 2007 Jorge Marin

31 May 2007 B Gurt

Does exactly what it needs to do.

22 Apr 2007 jonny e

Excellent and easy to use. I'd emphasize that one should call axis(axis) prior to plotting the arrow, or the axis limits will get reset which will render the arrow incorrectly. This is noted in the help, but tucked towards the bottom.

18 Apr 2007 Ramesh Rajasekaran

29 Dec 2006 Vassili Pastushenko

does not point to (1,1)

29 Dec 2006 Vassili Pastushenko

Good job. A small remark:

arrow([0 0],[1 1],50,10,30)

does not point to (0,1).

Probably it would be reasonable to add a feature of automatical swapping baseAngle and tipAngle, if baseAngle < tipAngle.

30 Oct 2006 Arun Karthi Subramaniyan

Great tool. Very easy to use with detailed documentation. Thanks for sharing it with us.

04 Oct 2006 J Xu

this program is really good, easy-use. 3x Erik.

09 Sep 2006 Nithya C.R.

The program is really great with all the aspects of plotting a directed line excellently covered.

24 Aug 2006 heath kitson

thanks eric

14 Mar 2006 JR P

This is great. I hate how MATLAB uses normalized figure coordinates in their annotation() call for drawing arrows. It makes no sense and someone at MathWorks got lazy, so it becomes nearly useless. This code is exactly what they should have done.. good job Erik!

14 Feb 2006 Jasper Menger

Nicely done. A shame by the way Matlab doesn't seem to have a builtin function for drawing arrows from the command line.

06 Feb 2006 Very satisfied

Exactly what I needed. Perfect!

15 Dec 2005 super tanne

22 Oct 2005 Shane Lin

I add the following comment at the file head. arrow(Start,Stop,'EdgeColor','b','FaceColor','b') color arrow.

25 Sep 2005 Vijaykumar Sathyamurthi

Thanks for this excellent tool. I hope you continue writing such winderful codes!!!

18 Sep 2005 Sharoni Shafir

Works great, thanks!

13 Sep 2005 Amit Kesar

Very good. Thank you.

29 Aug 2005 Changshun Deng

Good script!

29 Jul 2005 Dave Cogdell

This code (specifincally including the documentation (which is at the same time incomplete and inadequate) is far too complex for the simple thing(s) it does. I believe the author is an engineer: he should refrain from trying to write like a computer scientist and write like an engineer.

25 May 2005 Janik Zikovsky

Very good, better than annotation('arrow') because it is in axis units!

02 May 2005 Ian Mackenzie

20 Feb 2005 Evan Westwood

Couldn't figure out how to make the arrow line and arrow head have a specific color. Arrowheads didn't look as nice as those you might plot in drawing/presentation packages such as Powerpoint.

16 Jan 2005 Rattikan Saelim

13 Dec 2004 Nathaniel de Lautour

Superb effort. Highly configurable, easy to use and well documented to boot.

14 Oct 2004 Olivier Marsden

Very useful!

06 Oct 2004 Eddie Fiorelli

Excellent work, thorough documentation. Thanks!

06 Oct 2004 Mattias Forsblom


26 Jul 2004 Kelvin Rocha

Very useful. Explanations are excellent. Exactly what I was looking for.

09 Jun 2004 Gerald Dalley

Very nice

06 May 2004 ke wang

Very Useful and convenient. Easy to use!!

Comment only
24 Feb 2004 Arnd-Ragnar Rhiemeier

Excellent package. Help topics very comprehensive. Easy to use. Quickly leads to appealing graphical output. This package is exactly what I was looking for.

05 Jan 2004 Bernhard Boeck

That's exactly what I'm looking for

12 Oct 2003 Benedikt Halldorsson

Neat package, but (unless I'm missing something obvious) renders itself essentially USELESS.
Try setting the linestyle of the arrow line to dotted (set(h,'linestyle',':') and then try printing it out to a file (print -depsc test.eps) and view the postscript image. The line certainly is not dotted (on Matlab 6.5). Same problem with dashed and dot-dashed lines.
I'm not sure if this is an arrow.m problem, or Matlab's.

03 Jul 2003 Jakob van de Laar

Great package, it should be incorporated in
the standard Matlab distribution

01 May 2003 M Bakht

It is just great. Amazing.

17 Feb 2003 Niclas Borlin


02 Feb 2003 Aslak Grinsted

17 Dec 2002 a c

greatest function ever!

20 May 2009 1.1

Replace "eval('trycmd','catchcmd')" with "try, trycmd; catch, catchcmd; end;", which break's compatibility with MATLAB 5 but improves compliance with newer versions.

20 May 2009 1.2

actually update the file (not just the description); correct view on demo

24 May 2016 2.0

Updated for HG2 (R2014b and later)

25 May 2016 2.1

Added a 'Color' property (that sets both 'EdgeColor' and 'FaceColor' for arrows drawn with patch objects [the default]) and documentation of how to use it.

Contact us