Insert comment in the 4th quadrant of a subplot with Label and/or text

2 ビュー (過去 30 日間)
Jean-Hugues LE GALLOU
Jean-Hugues LE GALLOU 2021 年 4 月 13 日
Hello,
I create a figure with subplot(x,y,n)
graphs on the (2,2,1); (2,2,2) and (2,2,3).
and in the 4th quadrant I want to insert some text with a uilabel.
When I want to place a label in the figure towards the bottom right side, nothing is displayed without error.
This works if I don't use subplot.
How to insert one or more labels with a subplot?
Thanks in advance

回答 (2 件)

Alan Stevens
Alan Stevens 2021 年 4 月 13 日
Like so?
x = 0:0.1:10;
y = sin(x);
subplot(2,2,1)
plot(x,y)
subplot(2,2,2)
plot(x,y+1/2)
subplot(2,2,3)
plot(x,y-1/2)
subplot(2,2,4)
text(0.1,0.5,'Put text here?')
axis off

Jean-Hugues LE GALLOU
Jean-Hugues LE GALLOU 2021 年 4 月 13 日
Thank you for your answer (it works).
In fact, the text in my case allows to visualize an 'average' data.
But if I restart the calculation (keeping the graphs) to have another data then a new text is displayed on the first one. This becomes unreadable (overlay).
How can I remove the text - by a 'delete' maybe - and display it again with a new data ?
Thinking that with a label I will solve my problem (see my first question), the label is not displayed.
Thank you for your help.
Translated with www.DeepL.com/Translator (free version)
  2 件のコメント
Alan Stevens
Alan Stevens 2021 年 4 月 13 日
Does this do what you want?
x = 0:0.1:10;
y = sin(x);
subplot(2,2,1)
plot(x,y)
subplot(2,2,2)
plot(x,y+1/2)
subplot(2,2,3)
plot(x,y-1/2)
subplot(2,2,4)
text(0.1,0.5,'Put text here?')
cla
text(0.1,0.5,'New text ')
axis off
Jean-Hugues LE GALLOU
Jean-Hugues LE GALLOU 2021 年 4 月 14 日
Thank you
this answers my question

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by