why the text doesn't show on the plot?

Hi every one
I am using the text on plot with code:
str={'SyR=0.5'};
text(-4,4,str,'FontSize', 8);
the x limitation is ([-5 5]), and y limitation is ([0.2 7])
but the text doesn't show on the plot.
could you help me to solve this problem?
Thank you

6 件のコメント

Ive J
Ive J 2020 年 12 月 20 日
Please share your script.
plot(-10:10, -10:10, '.-')
text(-4, 4, 'test', 'FontSize', 8)
Walter Roberson
Walter Roberson 2020 年 12 月 20 日
Looks okay even with the xlim ylim given by the poster.
plot(-10:10, -10:10, '.-')
text(-4, 4, 'test', 'FontSize', 8)
xlim([-5 5])
ylim([0.2 7])
Walter Roberson
Walter Roberson 2020 年 12 月 20 日
Missing text is known to be a problem on:
  • some quite old releases (around R2011 time frame) when the renderer was set to opengl and the xlim had certain properties, especially if there was any transparency
  • on some really old Intel graphics cards that were long discontinued, and which Intel has not put out drivers for in more than 7 years (Windows)
  • on some Linux systems when hardware opengl driver was being used, depending on the exact libraries installed
  • on some newer Intel and AMD graphics cards in which the user was using a vendor driver that was more than 2 years old (Windows)
I recommend first updating to the latest graphics driver for your hardware. If that does not solve the problem, experiment with using opengl software
Mathieu NOE
Mathieu NOE 2020 年 12 月 20 日
hi
plot come first , text after , otherwise no display;
Walter Roberson
Walter Roberson 2020 年 12 月 20 日
Good point, Mathieu: if hold is not on then plot() will remove the current plot. You can, though, text() then hold on then plot()
Niloufar Baba adam
Niloufar Baba adam 2020 年 12 月 20 日
thank you all of you guys
the problem was about coming plot befor text

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

回答 (0 件)

カテゴリ

タグ

質問済み:

2020 年 12 月 20 日

コメント済み:

2020 年 12 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by