Hold text in different monitors

I'm having a little problem in my script, in my work i have to show a graph and a lot o values and data in it. I'm using the function "text", this function works fine, but when i go to another computer with a monitor with different size, the text goes to a different place, how do i hold the text in the same position in differents monitors?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de En. de 2014

0 votos

By default, text() uses Data coordinates for the positioning. You can set a different Units property to use a different base.
The size of text is controlled by its FontUnits, which defaults to "points".
If you use the defaults, "data" and "points", then you use monitors with different resolutions, or figures of different sizes, the relative positions of the text anchor points should stay the same, but the text will occupy less or more space on the screen.
If you set the axes position units to pixels, and the text Units and FontUnits to pixels, then the relative positions and sizes should be consistent; however you might encounter clipping if the one of the monitors does not have enough pixels.

Más respuestas (1)

Rafael
Rafael el 15 de En. de 2014
Editada: Walter Roberson el 15 de En. de 2014
How do i do this in practice?
what i do is this.
text(-22,8,'Im = ','FontWeight','bold');
text(-22,7,'Pole lat. = ','FontWeight','bold');
string3 = {num2str(latpolototal,'%0.1fº')};
string4 = {num2str(longpolototal,'%0.1fº')};
text(-18.5,7,string3); % Latitude do polo
text(-18.1,6,string4); % Longitude do polo
but in other monitor, the position changes.

2 comentarios

text(183,59,'Im = ','FontWeight','bold', 'Units', 'pixels'); %for example
Rafael
Rafael el 15 de En. de 2014
it worked, thanks a lot!

Iniciar sesión para comentar.

Categorías

Más información sobre Labels and Annotations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de En. de 2014

Comentada:

el 15 de En. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by