File Exchange

image thumbnail

Arrowhead

version 1.0 (4.4 KB) by

arrowh draws a solid 2D arrow head into the current plot.

4.76923
13 Ratings

16 Downloads

Updated

View License

This little program allows you to draw a solid arrow head (a triangle) into the current plot to indicate a direction on a line.

I wrote this little program mainely for use in phase plane plots (screenshot), when you want to indicate what direction a trajectory is run throught.

The m-file contains a detailed help.

Comments and Ratings (15)

Nice code. Very useful.

I think there is an issue when using arrowh with another File Exchange matlab code, export_fig (found at http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig) when exporting in pdf.

The exported figure has some weird white lines. Export_fig works for other plots, so I was wondering if it due to the arrowhead file.

Just a few comments:
1) It would be nice if 'location' of the arrows was done in a more sophisticated way. Sometimes (especially in solutions of ODEs) the points forming the trajectory cluster at one end. The code ends up placing the arrow not in the desired middle of the trajectory. Perhaps a re-scaling of the points of the trajectory so the arrow can be fitted in the middle?
2) Is there a way to avoid the re-scaling of the arrowheads when the axes of the figure are changed?

Thanks!

Pana

Florian Knorn

Florian Knorn (view profile)

@Miguel - sorry I can't. But it's quite easy, I just plotted the analytical solution of a 2D ODE with complex eigenvalues using initial conditions placed on a circle...

Hi Florian,
Could you please upload the code that you used to generate the phase portrait in your screenshot?
Cheers, Miguel

Joao

Joao (view profile)

Easy instructions, works just fine.

Pierce Brady

Excellent,
Could do with some more information regarding its use.

HIT

HIT (view profile)

thx

Tom

Tom (view profile)

cool beans!

cuh2o ?

yehua wei

it is useful

D G

Great and useful. Nice work.

Mircea Hossu

Matlab should include this useful function. Thanks!

frank behrends

good work !

benyuan liu

nice!

Micheal Heard

nice little prog, was always looking for one doing just that.

does what it says.

Micheal Heard

nice little prog, was always looking for one doing just that.

does what it says.

Updates

update:

1.13 - Allow for non-solid arrow heads
1.12 - Return handle(s) of created patches

Added functionality to change the width of the arrowhead, and fixed some mlint suggestions

Fix a bug pointed out by Kesh Ikum

i forgot to remove a silly debugging line which kept the size-argument from being taken into account...
thanks to Jeroen Hogema who mailed me about this issue

added the possibility to have several arrowheads drawn at once by giving a *vector* with the wanted locations for the LOCATION paramater

minors changements in the file-description and the comments of the prog;
functionality untouched

MATLAB Release
MATLAB 7 (R14)

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

» Watch video