Plot multiple quiver keeping arrows magnitude proportion
조회 수: 23 (최근 30일)
이전 댓글 표시
Hello! I have a simple question I am not able to solve properly. I will simplify the problem to the following:
Consider two sets of vector field data:
- F1=(x,y,u,v)
- F2=(x,y,2*u,2*v).
When I plot these data, the size of the arrows coming from F2 are the same as the ones coming from F1, despite the fact that they are actually doble length.
If I want quiver to autoscale the arrows, but to mantain the magnitue proportion between arrows for different data sets (by different calls to quiver), what is the best way of doing it?
An test code to show this issue is:
n=30;
x=randn(n,1);
y=randn(n,1);
u=randn(n,1);
v=randn(n,1);
quiver(x,y,u,v,'b');
hold on
quiver(x,y,2*u,2*v,'r')
legend('F1','F2')
hold off
댓글 수: 0
답변 (1개)
Hrishikesh Borate
2021년 7월 19일
편집: Hrishikesh Borate
2021년 7월 19일
Hi,
By default, the quiver function shortens arrows so they do not overlap. To disable automatic scaling so that arrow lengths are determined entirely by U and V, set the scale argument to 0. Following code demonstrates the same.
quiver(x,y,u,v,0,'b');
hold on
quiver(x,y,2*u,2*v,0,'r')
legend('F1','F2')
hold off
참고 항목
카테고리
Help Center 및 File Exchange에서 Condensed Matter & Materials Physics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!