Cannot set quiver head size bigger than 1/3 of the length of the arrow.
조회 수: 92 (최근 30일)
이전 댓글 표시
Hi,
I would like to control the arrow head for my quiver arrow plots. It does not seem like I can not set quiver head size bigger than 1/3 of the length of the arrow. Does anyone know how to do that or know a workaround? I have included an example where you can see I can set the size of the arrow head up until 1/3 of the length of the arrow, but not bigger then that.
figure
myquiver([0,0], [1,0], 0.1,'-',2);hold on;
myquiver([0,0.5],[1,0], 0.2,'-',2)
myquiver([0,1], [1,0], 0.3,'-',2)
myquiver([0,1.5],[1,0], 0.3333,'-',2)
myquiver([0,2], [1,0], 0.4,'-',2)
myquiver([0,2.5],[1,0], 0.5,'-',2)
myquiver([0,3], [1,0], 0.6,'-',2)
axis equal
function qh = myquiver(X,V,headSize,linStyle,linewidth)
qh = quiver(X(1),X(2),...
V(1),V(2),...
0,... % automatically scales the arrows to fit within the grid and then stretches them by the factor scale. scale = 2 doubles their relative length, and scale = 0.5 halves the length. Use scale = 0 to plot the velocity vectors without automatic scaling
'AutoScale','off',...
'MaxHeadSize',headSize*(3)/norm(V),... headSize is the head size,but it cannot be longer than 1/3 of the vector length (for some reason)
'LineWidth',linewidth,...
'LineStyle',linStyle);
![untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/212808/untitled.png)
댓글 수: 0
답변 (1개)
A. Sawas
2019년 4월 9일
There is a cutoff on how big the head size is compared to the norm of the arrow. If you can allow the norm to get longer you will be able to increase the head size.
Also, MaxHeadSize is a scalar value in units relative to the length of the arrow. So, the effective value is less than 1.
myquiver([0,2.5],[1,0], 0.5,'-',2); % head size is 0.5 of the norm=1
myquiver([0,3], [2,0], 0.6,'-',2); % head size is 0.6 of the norm=2
참고 항목
카테고리
Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!