struggeling with the quiver function
Mostrar comentarios más antiguos
My name is Hidde and i am working on a university project. I need to plot arrows inbetween serveral datapoints. I tried using the quiver function but the headwith gets
all weird. This is because my y axis runs from 0 to 500 and my x axis runs from 0 12. Does somebody know how to fix this? i want arrows with filled arrowheads that are all
the same size and shape regardless of arrow length ect.
i attached the relevant data and matlab files.
6 comentarios
Hidde Kemperink
el 6 de En. de 2021
Editada: Hidde Kemperink
el 6 de En. de 2021
The term "quiver" isn't mentioned anywhere in either m-file. Where are you applying the quiver function?
Also, make it very easy for us to help you by reducing the amount of work we need to do to understand the problem. There are more than 3900 lines of code between your two m-files.
Hidde Kemperink
el 6 de En. de 2021
Hidde Kemperink
el 6 de En. de 2021
Editada: Hidde Kemperink
el 6 de En. de 2021
Hidde Kemperink
el 6 de En. de 2021
I see what you're describing. A much simpler way to demonstrate this is,
clf()
axes()
endPoint = [5.8, 175]; % [x,y] of arrow end point
headPoint = [7, 200]; % [x,y] of arrow head
plot([endPoint(1),headPoint(1)],[endPoint(2),headPoint(2)],'r*')
xlim([0,12])
ylim([0,500])
grid on
hold on
uv = headPoint - endPoint; % [x,y] distance
quiver(endPoint(1),endPoint(2),uv(1), uv(2),'b-','AutoScale','off')
This is a difficult problem because the quiver() function does not provide a way to change the arrow heads other than to turn them off. The annotation function with the arrow lineType is an alternative but problematic because it only receives corrdinates normalized to the figure (not the axes) so you'd need to compute the normalized position of the arrow and never change the axis limits or ratio.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Vector Fields en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

