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 comentarios

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
Walter Roberson el 20 de Dic. de 2020
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 el 20 de Dic. de 2020
hi
plot come first , text after , otherwise no display;
Walter Roberson
Walter Roberson el 20 de Dic. de 2020
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 el 20 de Dic. de 2020
thank you all of you guys
the problem was about coming plot befor text

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Etiquetas

Preguntada:

el 20 de Dic. de 2020

Comentada:

el 20 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by