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

查看:33
本文介绍了如何在 Matlab 中用数据坐标绘制箭头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一个名为 annotation 的函数可以绘制箭头或双箭头.但是注释只能以标准化单位绘制.例如:

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] 应该是小于一的比率数.

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屋!

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