Cannot set quiver head size bigger than 1/3 of the length of the arrow.
54 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
A. Sawas
el 9 de Abr. de 2019
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
Ver también
Categorías
Más información sobre Vector Fields en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!