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 个评论

Please share your script.
plot(-10:10, -10:10, '.-')
text(-4, 4, 'test', 'FontSize', 8)
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])
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
hi
plot come first , text after , otherwise no display;
Good point, Mathieu: if hold is not on then plot() will remove the current plot. You can, though, text() then hold on then plot()
thank you all of you guys
the problem was about coming plot befor text

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by