问题描述
是否可以在子图中打印诸如ح"(U + 062D)之类的字符作为图像标题?
Is it possible to print some characters like 'ح' (U+062D) as the title of an image in a subplot?
推荐答案
使用某些Java,如 Yair Altman 在 undocumentedmatlab.com 上,可以将可识别HTML的标签添加到绘图中.因此,您可以使用&#xHEXCODE;
语法(在您的情况下为ح
:
Using some Java as described by Yair Altman on undocumentedmatlab.com, you can add HTML-aware labels to your plot. You can therefore put your Unicode character 'ح' (U+062D) into such a label using the &#xHEXCODE;
syntax, in your case ح
:
figure;
labelStr = '<html>ح</html>';
jLabel = javaObjectEDT('javax.swing.JLabel',labelStr);
[hcomponent,hcontainer] = javacomponent(jLabel,[100,100,40,20],gcf);
这应该显示一个空的图形窗口,其中仅包含单个Unicode字符.使用WinXP在Matlab R2010b上进行了测试.
This should display an empty figure window which just contains that single Unicode character. Tested on Matlab R2010b with WinXP.
有关诱骗MATLAB显示Unicode的更多信息,请参见,该帖子可能部分特定于OS X.
For more information about tricking MATLAB into displaying Unicode, see this SO post which might in parts be specific to OS X.
请注意,可以通过MATLAB title()
的本机LaTex功能以;但这远没有涵盖所有Unicode.
Note that a few characters which are not available in your current character set can be available through the native LaTex capabilities of MATLAB title()
as discussed here; however this is far from covering all of Unicode.
这篇关于是否可以在MATLAB中打印unicode文本或字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!