4.5

4.5 | 9 ratings Rate this file 83 downloads (last 30 days) File Size: 430.51 KB File ID: #14056

Arrow3 Version 5

by Tom Davis

 

22 Feb 2007 (Updated 13 May 2009)

Code covered by BSD License  

Draws lines with directional arrowheads.

Download Now | Watch this File

File Information
Description

ARROW3(P1,P2) draws lines from P1 to P2 with directional arrowheads. P1 and P2 are either nx2 or nx3 matrices. Each row of P1 is an initial point, and each row of P2 is a terminal point.

ARROW3(P1,P2,S,W,H,IP,ALPHA,BETA) can be used to specify properties of the line, initial point marker, and arrowhead. Type "help arrow3" at the command prompt for more information

What's new in Version 5:

All arrowhead and initial point marker sizes (W, H, and IP) are relative to the PlotBox diagonal.

Version 5 attempts to preserve the appearance of existing axes. In particular, ARROW3 will not change XYZLim, View, or CameraViewAngle. ARROW3 does not, however, support stretch-to-fill scaling. If a particular aspect ratio or variable limit is required, use DASPECT, PBASPECT, AXIS, or XYZLIM commands before calling ARROW3. Users are encouraged to report problems directly to the author.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Arrow3 version 4.58
This submission has inspired the following:
mArrow3.m - easy-to-use 3D arrow

MATLAB release MATLAB 6.5 (R13)
Zip File Content  
HTML Files Arrow3 Examples,
Arrow3 Messes Up My Plots!
Other Files
arrow3.m,
ex01.png,
ex02.png,
ex03.png,
ex04.png,
ex05.png,
ex06.png,
ex07.png,
ex08.png,
ex09.png,
ex10.png,
ex11.png,
ex12.png,
ex13.png,
ex14.png,
ex15.png,
ex16a.png,
ex16b.png,
ex16c.png,
fig01.png,
fig02.png,
fig03.png,
fig04.png,
fig05.png,
text.css
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
13 Mar 2007 maricel miguel

I havent tried it but looks good from the screen shot, what was the thought process on this one, and how long did it took you

24 Oct 2007 Ahmet Sacan

I was happily using arrow.m until I came to see that it for some reason did not draw anything when my m file was deployed (i.e., running executable that resulted from mcc). I came back to File Exchange for a different arrower instead of trying to debug arrow.m. Now I'm using arrow3 which works fine in deployed mode. thanks.

13 Apr 2008 dong ding

it's excellent.I can use it to draw my picture. thanks!

12 Sep 2008 Georg Stillfried

works fine

13 Dec 2008 Vaibhav Deshpande

I am doing a project in layup optimization of balanced symmetric laminates, and I wanted to display at each call to fmincon the material direction for my laminate, I was able to so by using arrow3, thank you.

Regards,
Vaibhav Deshpande.

27 Dec 2008 piao lin

it seems if I want to plot another plot3(......) with arrow3(.....)

I should

figure,arrow3(.....);
hold on;
axis equal ; %you'd better use axis equal
plot3(....);

if I put plot3(....) before arrow3(.....) ,just like below ,I get not see the result of arrow3(.....);

figure,plot3(....);
hold on;
axis equal ; %you'd better use axis equal
arrow3(.....);

29 Dec 2008 Tom Davis

It is not necessary to set AXIS EQUAL, but commands that may change the aspect ratio should be issued _before_ calling ARROW3. ARROW3 draws surfaces that look like right circular cones and spheres no matter the aspect ratio, but the ratio must be fixed, and changing the ratio will distort the surfaces.

There are many examples in the HTML files that illustrate how to use ARROW3 before and after PLOT, POLAR, CONTOUR, PLOT3, SURF, SLICE, and PATCH.

21 Jan 2009 Philipp Wissgott

On my matlab (R2007a) the line of the arrow is visible after the tip of the arrowhead in 2D plots. It looks like as if the arrowhead is plotted at the wrong position.
In my example arrow3 is called after some calls of "line()" and "rectangle()". I can supply further information if required.

23 Jan 2009 Tom Davis

Wide lines may obscure the arrowhead tip, but the line endpoint and arrowhead tip are _always_ coincident.

01 Apr 2009 Lei Shang  
01 Apr 2009 Lei Shang

Very useful with 3D plots. But when I'm copying figures to word, all the nice arrows plotted by 'arrow3.m' disappeared. And my command window displays:

Warning: RGB CData not yet supported in Painter's mode
> In graphics\private\restorehg at 100
  In graphics\private\restore at 29
  In print at 277
  In editmenufcn at 78

How do I fix this?

02 Apr 2009 Tom Davis

Instead of using Copy Figure from the Edit menu, use Save As from the File menu, save the figure as a PNG file, and then insert the PNG file into Word.

20 Jul 2009 Gabriel Akira Schreiber  
05 Aug 2009 Gabriel Akira Schreiber  
Please login to add a comment or rating.
Updates
12 Mar 2007

improved code metrics

11 Apr 2007

added dialog

11 Apr 2007

added dialog

13 Apr 2007

dialog revision

29 May 2007

magnitude coloring and documentation revision

04 Jun 2007

more examples

05 Jun 2007

more examples

15 Jun 2007

corrected example 2

18 Jun 2007

simplified example 10

25 Jun 2007

added example references; check for empty input

25 Jun 2007

added example references; check for empty input

02 Jul 2007

modified named colors to match default ColorOrder

09 Jul 2007

modified named colors to match Simulink colors

16 Jul 2007

revised html files

17 Jul 2007

new screenshot

25 Jul 2007

ignore zero-magnitude input

10 Sep 2007

added cone plot option

01 Oct 2007

changed screenshot

24 Oct 2007

zero magnitude bug fix

17 Mar 2008

updated contact information

22 Sep 2008

revised html files

13 May 2009

corrected spelling errors

Tag Activity for this File
Tag Applied By Date/Time
annotation Tom Davis 22 Oct 2008 09:01:35
customization Tom Davis 22 Oct 2008 09:01:35
arrow Tom Davis 22 Oct 2008 09:01:35
line Tom Davis 22 Oct 2008 09:01:35
vector Tom Davis 22 Oct 2008 09:01:35
arrowhead Tom Davis 22 Oct 2008 09:01:35
arrow3 Tom Davis 22 Oct 2008 09:01:35
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com