File Exchange

image thumbnail


version (4.4 KB) by Florian Knorn
arrowh draws a solid 2D arrow head into the current plot.


Updated 23 Jun 2008

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.

Cite As

Florian Knorn (2021). Arrowhead (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (20)

Randy A Lemons


Oskar Sadowski

Ahmed Taha

very useful

Muhammad Usman Saleem

I want to show direction of track this will be a ray having arrow at the end which shows its direction. Is this possible to adjust the arrow at the end of the line?

Nice code. Very useful.

I think there is an issue when using arrowh with another File Exchange matlab code, export_fig (found at 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?



Florian Knorn

@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...

Miguel Combariza

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


Easy instructions, works just fine.

Pierce Brady

Could do with some more information regarding its use.




cool beans!

cuh2o ?

yehua wei

it is useful


Great and useful. Nice work.

Mircea Hossu

Matlab should include this useful function. Thanks!

frank behrends

good work !

benyuan liu


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.

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

Community Treasure Hunt

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

Start Hunting!