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
2020-12-20
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])
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
2020-12-20
hi
plot come first , text after , otherwise no display;
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
2020-12-20
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
