I have a figure in MATLAB. Then I add a text to it by typing,
b = text(0.5, 0.5, 'Detector action', 'Rotation', -70, 'FontSize', 25);
But the text goes behind the figure (See below),
I also tried,
uistack(b, 'top');
but it didn't work.
The easiest way is not to bother with a text
at all, but instead use an annotation
, since such an object will be (at least by default) above the axes (and thus, anything plotted inside them).
The trick with annotation
objects, is that counter-intuitively, we need not use a TextBox
, but instead a TextArrow
, while making the arrow itself invisible.
For example:
figure(); membrane();
annotation('TextArrow', [.5 .5], [.5 .5], 'String','Some text', 'TextRotation', -30, ...
'HeadStyle','none','TextBackgroundColor','w' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With