Text size in figure relative to figure window

11 ビュー (過去 30 日間)
Lennart Zielstra
Lennart Zielstra 2022 年 10 月 22 日
コメント済み: VBBV 2022 年 10 月 24 日
I am making a bar plot with some short text on the side. I noticed that when I increase the size of the window the figure is in everything scales except for the text. This causes the text to apear really small when the window is big and vice versa. How can i make sure the text has the same relative size as the figure window?
My code:
hold on
patch([-11 11 11 -11], [-11 -11 11 11],'w')
patch([-2 2 2 -2], [-8 -8 8 8],'r')
axis([-10 10 -10 10])
axis off
FB_text_ = text(6,2,FB_Instruction,'FontSize',25)
Some example pictures:

採用された回答

VBBV
VBBV 2022 年 10 月 22 日
編集済み: VBBV 2022 年 10 月 22 日
FB_text_ = text(6,2,FB_Instruction,'FontUnits','normalized','FontSize',25)
  3 件のコメント
Lennart Zielstra
Lennart Zielstra 2022 年 10 月 22 日
Thanks! Worked perfectly when I changed the order to:
FB_text_ = text(6,2,FB_Instruction,'FontSize',25,'FontUnits','normalized')
VBBV
VBBV 2022 年 10 月 24 日
Please accept the answer if it worked for you.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by