Quiver scale variables differently?

조회 수: 7 (최근 30일)
JEC PsiCom
JEC PsiCom 2011년 5월 23일
댓글: Francois Clemens 2019년 4월 21일
Hello. I have this problem.
I have two different types of flux/velocity variables (in u and v) that I want to compare using a quiver plot. The problem is that one of the variables is scaled a LOT bigger than the other variable, no matter the actual physical values it has. For examplem, if I force it smaller by multiplying by 0.001 or something, it STILL shows these huge arrows. That is, variable 2 has longer quiver arrows than variable 1 even though the values it has is smaller.
ps; I've tried to set 'autoscaling','off', but it doesn't help.
What's going on? :/
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2011년 5월 23일
Post code and input examples: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
and format the code: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question

댓글을 달려면 로그인하십시오.

답변 (3개)

Sean de Wolski
Sean de Wolski 2011년 5월 23일

Two ideas:

  • Use the scale input to quiver
doc quiver
  • Normalize the arrows to be the exact same range:
u2 = u2./(max(u2(:))).*max(u1(:));

Tim Whiteley
Tim Whiteley 2017년 11월 13일
Hello. I am having the same problem as JEC PsiCom. Here is an example of some toy code where x and y are different scales. When plotted, the y scale of the arrowheads is hugely disproportional (the vertical lines being the arrowheads). Any help would be much appreciated.
x=-10:10;
y=0.00001:0.00001:0.00010;
[X,Y]=meshgrid(x,y);
quiver(x,y,X,Y);
  댓글 수: 2
Francois Clemens
Francois Clemens 2019년 4월 19일
Hi I have something similar, although in my case he variabale on th y-axis is scaled:
when I give the command:
quiver(r,dr,vradiaal,dvrad);
I get the graph with the blue arrows:
WhenI I plot using the command:
p1=[r,r+dr];
p2=[vradiaal,vradiaal+dvrad];
plot(p1,p2,'-k');
I get the graph in black, Tthe numerical values correspond with the graph in black so clearly the y axis is scaled down by quiver by a factor of approx 100. Anybody an idea????
thanks in advance
Francois Clemens
P.S. I'm using Matlab R 2017b
plot_exp.jpg
quiver_exp.jpg
Francois Clemens
Francois Clemens 2019년 4월 21일
Forget it, I mixed up the order of the variables, the issue raised by JEX Psicom remains....

댓글을 달려면 로그인하십시오.


abuzer
abuzer 2013년 4월 2일
you should cahnge the scale parameter.
scale=1; axis equal; hold on plot(x,y,'o'); h=quiver(x, y, v, u, scale);

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by