答案 0 :(得分:3)
您不能简单地使用U
之类的内容,因为quiver
会将自动计算的比例应用于V
和quiver
,以便所有箭头都很好地适合于图中。您需要包含该比例。
查看%// Example data
x = rand(1,20);
y = rand(1,20);
u = rand(1,20);
v = rand(1,20);
%// Taken from "quiver.m". Computes autoscale
if min(size(x))==1, n=sqrt(numel(x)); m=n; else [m,n]=size(x); end
delx = diff([min(x(:)) max(x(:))])/n;
dely = diff([min(y(:)) max(y(:))])/m;
del = delx.^2 + dely.^2;
if del>0
len = sqrt((u.^2 + v.^2)/del);
maxlen = max(len(:));
else
maxlen = 0;
end
if maxlen>0
autoscale = 0.9 / maxlen;
else
autoscale = 0.9;
end
%// quiver plot
quiver(x, y, u, v)
hold on
%// plot marker at arrow tips, including computed autoscale
plot(x+autoscale*u, y+autoscale*v, 'o')
代码并复制计算该比例的部分,您可以按以下步骤操作:
quiver
如果将比例参数指定为plot
,则该参数是将内部计算比例相乘的因子。所以你必须在%// quiver plot including manual scale factor
quiver(x, y, u, v, .5)
hold on
%// plot marker at arrow tips, including computed autoscale and manual scale
plot(x+.5*autoscale*u, y+.5*autoscale*v, 'o')
中包含它:
1: ${aaa.bbb.ccc}
2: ddd.eee=http://@URL@/link
fff.ggg=@PORT@