How to change the Head Properties of a vector?
2 views (last 30 days)
Show older comments
I want to change the HeadProperties of a vector.
In the example below I show the problems:
SCRIPT:
clear all;
close all;
U=[1 2 3 4 5 6 7 8 9 10];
V=[0 0 0 0 0 0 0 0 0 0];
x=[-0.35 -0.37 -0.38 -0.40 -0.40 -0.41 -0.41 -0.42 -0.42 -0.417];
y=[-0.11 -0.10 -0.09 -0.08 -0.06 -0.04 -0.02 0.001 0.024 0.047];
Vector=[U' V' x' y'];
quiver(Vector(:,1), Vector(:,2), Vector(:,3), Vector(:,4), 0, 'LineWidth', 1, 'MaxHeadSize', .1);
axis([0 11 -0.2 0.2])
PROBLEMS
First, the vector heads are opened ones and I want to have solid heads.
Second, the head is not symmetric relative to solid line, but it changes its property with direction. I wand to have
symmetric sides for any vector direction.
Third, the function MaxHeadSize is not working and I don't know why.
I already look in the documentation for vector plot, quiver, etc... and did not find the instructions. I wonder if someone is familiar with this problem and could help me.
Thanks in advance for your attention
Emerson
[EDITED, JSimon, 20-Oct-2011 11:33 UTC, Code formatted]
1 Comment
Jan
on 20 Oct 2011
Please use code formatting as explained at the "Markup help" link on this page.
About the useless "clear all" see: http://www.mathworks.com/matlabcentral/answers/16484-good-programming-practice#answer_22301
Accepted Answer
Jan
on 20 Oct 2011
Obviously the arrow head donot consider the AXES' DataAspectRatio. If you equilize the ratio of X- and Y-coordinates, the arrow heads are ok:
axis equal
But you want to set the axes limits manually. Therefore I recommend to use a smarter arrow drawer from the FEX:
- http://www.mathworks.com/matlabcentral/fileexchange/14056-arrow3-version-5
- http://www.mathworks.com/matlabcentral/fileexchange/31473-line2arrow-add-an-arrowhead-to-a-plotted-line
- http://www.mathworks.com/matlabcentral/fileexchange/29487-2d-vector-field-visualization
- http://www.mathworks.com/matlabcentral/fileexchange/28324-3d-arrow-plot
- http://www.mathworks.com/matlabcentral/fileexchange/27475-arrow-plotter
- http://www.mathworks.com/matlabcentral/fileexchange/25372-marrow3-m-easy-to-use-3d-arrow
- http://www.mathworks.com/matlabcentral/fileexchange/278-arrow-m
- http://www.mathworks.com/matlabcentral/fileexchange/23263-streakarrow3d
- http://www.mathworks.com/matlabcentral/fileexchange/12274-3d-arrow-with-many-colorparameter-options
- http://www.mathworks.com/matlabcentral/fileexchange/7470-plot-2d3d-vector-with-arrow
- http://www.mathworks.com/matlabcentral/fileexchange/6066-quiver3d
- http://www.mathworks.com/matlabcentral/fileexchange/3345-plot-arrowhead
The number of submissions implies, that your problem appeares frequently. The searching in the FEX is a good idea...
0 Comments
More Answers (0)
See Also
Categories
Find more on Vector Fields in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!