Text overlapp in uifigure plot

30 ビュー (過去 30 日間)
Life is Wonderful
Life is Wonderful 2020 年 6 月 10 日
編集済み: Life is Wonderful 2022 年 7 月 21 日
Hi
I'm using text to plot the text in a user interface figure (x,y,str). I was unable to see the original text message since they overlapped.
Can someone please tell me how to prevent the words from overlapping?
Thank you!
  19 件のコメント
Life is Wonderful
Life is Wonderful 2020 年 6 月 12 日
Some how- I don't see accept answer option!
Adam Danz
Adam Danz 2020 年 6 月 12 日
That's because this discussion has been in the comments section. I just added an answer that summarizes the solution.

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

採用された回答

Adam Danz
Adam Danz 2020 年 6 月 12 日
Here are two ways to control the position of text in a plot
Use Matlab's text() function
The HorizontalAlignment and VerticalAlignment properties control the text position relative to the coordinate.
fig = figure();
ax = axes(fig);
textSamples = {'First Row', 'Second Row', 'Third Row'};
x = 1:3
y = 1:3;
plot(ax, x, y, 'bo')
hold(ax, 'on')
% Example of text()
text(ax, x+.05, y, textSamples,'HorizontalAlignment', 'Center', 'VerticalAlignment', 'Bottom')
xlim([0,4])
ylim([0,4])
Use labelpoints() from the file exchange
The same example above can be done with this line below. The 'N' input specifies that the text should be North of the coordinates.
labelpoints(x,y,textSamples,'N','color','b') % N is for North
  2 件のコメント
Life is Wonderful
Life is Wonderful 2020 年 7 月 19 日
Hi Adam,
Can you please help with below link issue
You suggestion and guidance would be a great help for me ! Thank you!
Life is Wonderful
Life is Wonderful 2020 年 8 月 28 日

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by