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?

 採用された回答

Walter Roberson
Walter Roberson 2014 年 1 月 15 日

0 投票

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.

その他の回答 (1 件)

Rafael
Rafael 2014 年 1 月 15 日
編集済み: Walter Roberson 2014 年 1 月 15 日

0 投票

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 件のコメント

Walter Roberson
Walter Roberson 2014 年 1 月 15 日
text(183,59,'Im = ','FontWeight','bold', 'Units', 'pixels'); %for example
Rafael
Rafael 2014 年 1 月 15 日
it worked, thanks a lot!

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

カテゴリ

ヘルプ センター および File ExchangeLabels and Annotations についてさらに検索

タグ

質問済み:

2014 年 1 月 15 日

コメント済み:

2014 年 1 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by