如何在Matlab中绘制带有数据坐标的箭头? [英] How to plot arrow with data coordinates in Matlab?
问题描述
我知道有一个名为注解的功能可以绘制箭头或双箭头.但是注释只能以标准化单位绘制.例如:
I know there is a function named annotation can plot arrows or double arrows. But annotation can only plot in normalized unit. For example:
annotation('arrows',[x1 x2],[y1 y2])
在此,[x1,x2]的比例数应小于1.
Here, [x1, x2] should be a ratio number less than one.
所以,我的问题是如何绘制带有真实值而不是归一化值的箭头?
So, my question is how can I plot arrows with a true value rather than a normalized value?
我想知道是否有任何其他函数可以实现这一目标,或者有什么函数可以获取图形的轴值,以便可以将真实值调整为归一化值.
I wonder if there is any other function can approach this or is there any function I can get the axis value of the figure so that I can adjust the true value into a normalized value.
推荐答案
我刚刚发现了此方法,因为我不想麻烦归一化单位.使用乳胶解释器:
I've just discovered this method, since I don't want to have to bother with normalised units. Use the latex interpreter:
figure
plot([1:5],[1:5]*3,'.-')
%// Say I want to put an arrow pointing to the location, [3 9]
text(2.94,8.3,'\uparrow','fontsize',20)
text(2.8,7.8,'point [3,9]')
要使箭头更长,请使用较大的字体.
To make the arrow longer, use a larger fontsize.
专业人士
- 比使用标准化单位更容易,更快,更快
- 不需要安装任何功能(对我们这些懒惰的人来说很好.)
- 利用LaTeX解释器,可以使用各种箭头(向上,向下,向左,向右和其他角度)(请参见 缺点
- 绝对需要反复试验/调整才能获得箭头相对于POI的正确位置.
- 对箭头长度的控制有限
- 解释器(boo)无法理解某些乳胶命令.
这篇关于如何在Matlab中绘制带有数据坐标的箭头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!