plot_dir improved and extended to handle matrices.


Updated 14 Dec 2004

No License

DIRECTEDPLOT Plot with directions

DIRECTEDPLOT(X,Y) plots vector Y versus vector X, with arrows on alternative points. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix,whichever line up.

DIRECTEDPLOT(X,Y,N) places arrows on each N-th point, starting from the first.

DIRECTEDPLOT(X,Y,N,LINESPEC) uses the plot linestyle specified for the plots and the arrows. See PLOT for other possibilities.

[H1,H2] = DIRECTEDPLOT(...) also returns the handles for the plot and the arrows

x = linspace(0,2*pi,10)';
y = [cos(x) sin(x)];
[h1,h2] = directedplot(x,y);
axis equal

Cite As

Mukhtar Ullah (2023). DIRECTEDPLOT (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Vector Fields in Help Center and MATLAB Answers

Inspired by: Plot With Direction

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes