フィルターのクリア

How do I plot a quiver plot without the tail?

7 ビュー (過去 30 日間)
David Martin
David Martin 2024 年 5 月 12 日
コメント済み: Star Strider 2024 年 5 月 12 日
I want the (head) arrows on the curve and no tail.

採用された回答

Star Strider
Star Strider 2024 年 5 月 12 日
編集済み: Star Strider 2024 年 5 月 12 日
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)
x = 1x10
-0.3439 2.5879 -0.0453 0.7373 0.1921 -1.9661 -1.3703 -1.6124 -1.7509 0.4401
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y = randn(1,10)
y = 1x10
-0.3366 -0.9526 0.2545 -0.5438 -1.4376 0.4723 0.4253 -0.7628 -0.7856 0.6550
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
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 件のコメント
David Martin
David Martin 2024 年 5 月 12 日
Bummer. I appreciate the answer anyway.
Star Strider
Star Strider 2024 年 5 月 12 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 5 月 12 日
quiver(___,LineSpec) sets the line style, marker, and color. Markers appear at the points specified by X and Y. If you specify a marker using LineSpec, then quiver does not display arrowheads.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by