如何在Matlab中绘制带有数据坐标的箭头? [英] How to plot arrow with data coordinates in Matlab?

查看:923
本文介绍了如何在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.

专业人士

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆