How can I adjust the arrowhead proportions when creating a Quiver plot whose X- and Y- data ranges differ substantially?

조회 수: 10 (최근 30일)
I am attempting to create a Quiver plot using the data below, but the arrowheads have substantial overlap, resulting in a confusing plot.
x = 15:24;
y = 0.5:0.01:0.59;
u = ones(10);
v = 0.01*ones(10);
quiver(x,y,u,v)
xlim([min(x) max(x)])
ylim([min(y) max(y)])

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 8월 17일
This issue is due to the way the arrowheads are scaled in relation to the range of the axes.
As a workaround, the Quiver plot can be created on a set of axes with equal ranges. Then the axes can be re-labeled appropriately. For example,
x = 15:24;
y = 0.5:0.01:0.59;
u = ones(10);
v = 0.01*ones(10);
scale_factor = range(x)/range(y);
figure;
ah = axes;
quiver(x,y*scale_factor,u,v*scale_factor)
xlim([min(x) max(x)])
ylim([min(y) max(y)]*scale_factor)
set(ah,'YTick',y*scale_factor)
% properly re-label to y-axis
set(ah,'YTickLabel',y)

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by