MATLAB:把一个圈数上的图 [英] matlab: putting a circled number onto a graph

查看:286
本文介绍了MATLAB:把一个圈数上的图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个圆圈数字上的图形作为标记的附近的(但不是)一个点。听起来很简单,但我也想成为不变的变焦/长宽比的变化。

I want to put a circled number on a graph as a marker near (but not on) a point. Sounds easy, but I also want to be invariant of zoom/aspect ratio changes.

由于这种不变的,我不能画一个圆作为线对象(不重绘后的重新调整);如果我用一个圆圈标记,我不得不调整其在重新调整所抵消。

Because of this invariant, I can't draw a circle as a line object (without redrawing it upon rescale); if I use a circle marker, I'd have to adjust its offset upon rescale.

我能想到的最简单的方法就是使用统一code或宋体字① ② ③在等了文本()函数的字符串。但单code似乎没有工作的权利,而下面的示例只&#x2460工程;并没有为其它数目(其产生矩形框):

The simplest approach I can think of is to use the Unicode or Wingdings characters ① ② ③ etc. in a string for the text() function. But unicode doesn't seem to work right, and the following sample only works with ① and not for the other numbers (which yield rectangle boxes):

作品:

clf; text(0.5,0.5,char(129),'FontName','WingDings')

不工作(应该是一个圆圈2):

doesn't work (should be a circled 2):

clf; text(0.5,0.5,char(130),'FontName','WingDings')

是什么给了,任何人都可以提出一个解决办法?

What gives, and can anyone suggest a workaround?

推荐答案

这似乎为我工作,利用Matlab的乳胶间preTER和 \\ textcircled

This seems to work for me, uses Matlab's latex interpreter, and \textcircled:

clf; text(0.5, 0.5, '$\textcircled{2}$', 'Interpreter', 'latex')

\\ textcircled 命令似乎有一定的偏移问题的,也许你可以尝试提高使用乳胶命令,并让我们知道:)

The \textcircled command seems have some offset problems, maybe you can try to improve the used latex command and let us know :)

按照上面的链接,例如,我得到更好的效果:

Following the above link, for example, I get better results with:

clf; text(0.5, 0.5, '$\raisebox{.5pt}{\textcircled{\raisebox{-.9pt} {2}}}$', 'Interpreter', 'latex')

不过,两位数字看起来糟透了。

Still, two digit numbers look awful.

这篇关于MATLAB:把一个圈数上的图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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