仅绘制箭袋的终点

时间:2015-09-07 10:32:17

标签: matlab matlab-figure

我需要绘制一个与平衡状态有小偏差的点块。使用quiver它看起来像这样:

enter image description here

现在我想绘制位于箭头尖端的标记。怎么做?

输入数据是U和V偏差(在笛卡尔坐标轴上),得到矢量原点的X,Y坐标不是问题。

1 个答案:

答案 0 :(得分:3)

您不能简单地使用U之类的内容,因为quiver会将自动计算的比例应用于Vquiver,以便所有箭头都很好地适合于图中。您需要包含该比例。

查看%// 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@

enter image description here