How do I plot a quiver plot without the tail?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
David Martin
le 12 Mai 2024
Commenté : Star Strider
le 12 Mai 2024
I want the (head) arrows on the curve and no tail.
0 commentaires
Réponse acceptée
Star Strider
le 12 Mai 2024
Modifié(e) : Star Strider
le 12 Mai 2024
It doesn’t appear to be possible to turn the tails off, since there doesn’t appear to be any specific ‘tail-length’ property, and the available properties interact.
The best you can probably hope for is something like this —
x = randn(1,10)
y = randn(1,10)
u = x/10;
v = y/10;
a = atan2d(y, x);
figure
hq = quiver(x, y, u, v);
grid
text(x, y, compose('a = %.3f',a))
% get(hq)
figure
plot(x, y, '.r', 'MarkerSize',0.1)
for k = 1:numel(x)
text(x(k), y(k), 'v', 'Vert','middle', 'Horiz','center', 'Rotation',a(k)-270)
end
grid
EDIT — Minor code correction.
.
2 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!