Arrow lengths don't represent the ratio of velocities for 2 Quiver Plots

1 回表示 (過去 30 日間)
I have plotted two sets of velocity data for the same position data in a single quiver plot.
figure
quiver(xposition,yposition,uvelocity,vvelocity,'b')
hold on
quiver(xposition,yposition,v2dprime(1,:)',v2dprime(2,:)','r')
axis equal
But, visually from Figure 1, the length of arrows of the second dataset (red) is huge in comparison to the first dataset (blue). This is happening despite the actual velocities being comparable or in some cases, uvelocity(vvelocity) being greater than v2dprime. I would like the length of vectors originating at every point to represent the actual ratio of velocities. If I turn the scaling off, the first dataset (blue) is weirdly magnified as in Figure 2.

採用された回答

VBBV
VBBV 2023 年 5 月 27 日
D = load('Data.mat');
figure
quiver(D.xposition,D.yposition,D.uvelocity,D.vvelocity,'b','AutoScaleFactor',2.5)
hold on
quiver(D.xposition,D.yposition,D.v2dprime(1,:)',D.v2dprime(3,:)','r')
% axis equal
  2 件のコメント
VBBV
VBBV 2023 年 5 月 27 日
If you use AutoScaleFactor, property you can set the arrow lengths according to red color graph,
PASUNURU SAI VINEETH
PASUNURU SAI VINEETH 2023 年 5 月 28 日
Thanks for the response. An AutoScaleFactor of 30 for blue graph is keeping things in proportion. Is it always trial and error though? I was hoping there would be a way the program can take care of it.

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

その他の回答 (1 件)

鑫源
鑫源 2023 年 5 月 27 日
plot the histogram, you 'll find the blue one in fact exists a few exaggeratedly large vecs. Though average length of the blue one and the red are comparalbe. I think that's the problem
C={[uvelocity, vvelocity],[v2dprime(1,:)',v2dprime(2,:)'],}
D=cellfun(@(x)vecnorm(x,2,2),C,UniformOutput=false);
>> histogram(D{1})
>> histogram(D{2})
  1 件のコメント
鑫源
鑫源 2023 年 5 月 27 日
MaxHeadSize
AutoScale
AutoScaleFactor
notice these props

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

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by