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

10 views (last 30 days)
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)])

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Aug 2009
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)

More Answers (0)

MathWorks Support

Categories

Find more on Vector Fields in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!