Rank: 60 based on 631 downloads (last 30 days) and 1 file submitted
photo

Erik Johnson

E-mail
Company/University
Univ of Southern California

Personal Profile:

Associate Professor & Associate Chair, Astani Department of Civil & Env. Engineering, University of Southern California
B.S. (1988), M.S. (1993), Ph.D. (1997), Aeronautical & Astronautical Engineering, University of Illinois at Urbana-Champaign
http://www.usc.edu/dept/civil_eng/johnsone/

Professional Interests:

 

Watch this Author's files

 

Files Posted by Erik
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 May 2009 Screenshot arrow.m Draw a line with an arrowhead. Author: Erik Johnson arrow, annotation, line, arrowhead, customization, potw 631 72
  • 4.59722
4.6 | 75 ratings
Comments and Ratings on Erik's Files View all
Updated File Comment by Comments Rating
14 May 2012 arrow.m Draw a line with an arrowhead. Author: Erik Johnson zhang, Jiangmin
07 May 2012 arrow.m Draw a line with an arrowhead. Author: Erik Johnson Matthias

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 arrow.m Draw a line with an arrowhead. Author: Erik Johnson ATN

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.

16 Mar 2012 arrow.m Draw a line with an arrowhead. Author: Erik Johnson Wang, Yuanye

exactly what I need. thanks a lot.

14 Feb 2012 arrow.m Draw a line with an arrowhead. Author: Erik Johnson Tobias

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];

figure
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!

BW,
Tobi

Top Tags Applied by Erik
annotation, arrow, arrowhead, customization, graphics
Files Tagged by Erik
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 May 2009 Screenshot arrow.m Draw a line with an arrowhead. Author: Erik Johnson arrow, annotation, line, arrowhead, customization, potw 631 72
  • 4.59722
4.6 | 75 ratings

Contact us at files@mathworks.com