如何在Matlab图形的数据光标中添加希腊字母? [英] How to add Greek letter to data cursor in Matlab figure?

查看:303
本文介绍了如何在Matlab图形的数据光标中添加希腊字母?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Matlab图形中添加了一个数据游标,这是单击编辑文本更新功能..."时显示的代码.

I added a data cursor in a Matlab figure, and this it the code shown when I clicked "Edit Text Update Function..."

function output_txt = myfunction(obj,event_obj)
% Display the position of the data cursor
% obj          Currently not used (empty)
% event_obj    Handle to event object
% output_txt   Data cursor text string (string or cell array of strings).

pos = get(event_obj,'Position');
output_txt = {['X: ',num2str(pos(1),4)],...
    ['Y: ',num2str(pos(2),4)]};
% If there is a Z-coordinate in the position, display it as well
if length(pos) > 2
    output_txt{end+1} = ['Z: ',num2str(pos(3),4)];
end

我在这里要做的是用希腊字母(例如"alpha"或"beta")替换字符"X","Y".我该怎么办?

What I want to do here is replacing the characters 'X', 'Y' by the Greek character like 'alpha' or 'beta'. How can I do that?

谢谢!

推荐答案

\ alpha(和某些LaTeX符号)在标题中起作用,在这种情况下也可能起作用. 注意:\ Alpha是大写希腊字母,\ alpha是小写字母.

\alpha (and some LaTeX symbols) works in title and probably in this case too. Note: \Alpha is the capital greek letter, \alpha is the small one.

请参见此.

另请参阅Amro注释以激活(La)TeX解释器.

EDIT : See also Amro comments to activate the (La)TeX interpreter.

这篇关于如何在Matlab图形的数据光标中添加希腊字母?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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