将文字带到情节的正面

Moh*_*mad 4 matlab text rotation matlab-figure bringtofront

我在MATLAB中有一个数字.然后我通过输入添加一个文本,

b = text(0.5, 0.5, 'Detector action', 'Rotation', -70, 'FontSize', 25);
Run Code Online (Sandbox Code Playgroud)

但文字背后的数字(见下文), 在此输入图像描述

我也试过了,

uistack(b, 'top');
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

Dev*_*-iL 6

最简单的方法是不打扰a text,而是使用a annotation,因为这样的对象将(至少在默认情况下)在轴上方(因此,在其中绘制的任何内容).

有诀窍annotation的对象,是与直觉相反,我们需要使用TextBox,而是一个TextArrow,同时使箭头本身不可见.

例如:

figure(); membrane(); 
annotation('TextArrow', [.5 .5], [.5 .5], 'String','Some text', 'TextRotation', -30, ...
           'HeadStyle','none','TextBackgroundColor','w' );
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述