TiledLayou​tの軸ラベルのフォン​トを変更したい

4 Ansichten (letzte 30 Tage)
Yuya Akamatsu
Yuya Akamatsu am 10 Jan. 2022
Kommentiert: Yuya Akamatsu am 28 Jan. 2022
TiledLayoutで図を作成する際に,共通の軸ラベルのフォントを変更するために以下のようなコードを作成したのですが,反映されません.
axを指定するとフォントが変更されるのですが,tを指定しても変更されません.
Textのプロパティを見てみると,FontName自体はTimes New Romanに変更されているようですが,
Figureではデフォルトのフォント(Hiragino Kaku Gothic Pro)で表示されたままになってしまいます.
コマンド上で軸ラベルのフォントを変更するにはどうすればよいのでしょうか.
また,startup.mでデフォルトのフォントを設定することはできるのでしょうか.
matlabのバージョンはR2020b,PCはmac(macOS Catalina)です.
x = 0:10:360;
t = tiledlayout(2,1);
ax(1) = nexttile;
plot(x,sind(x))
ax(2) = nexttile;
plot(x,cosd(x))
l1 = ylabel(t,'Y LABEL');
l2 = ylabel(ax(1),'y label');
l1.FontName = 'Times New Roman'
l1 =
Text with properties: String: 'Y LABEL' FontSize: 11 FontWeight: 'normal' FontName: 'Times New Roman' Color: [0.1500 0.1500 0.1500] Interpreter: 'tex' Show all properties
l2.FontName = 'Times New Roman'
l2 =
Text (y label) with properties: String: 'y label' FontSize: 9.9000 FontWeight: 'normal' FontName: 'Times New Roman' Color: [0.1500 0.1500 0.1500] HorizontalAlignment: 'center' Position: [-27.0938 9.5367e-07 -1] Units: 'data' Show all properties
  2 Kommentare
Atsushi Ueno
Atsushi Ueno am 10 Jan. 2022
同じプログラムで'TakaoMincho'フォントを設定したところ、明らかにそれと判るフォントが表示されました。
私には質問の方に表示された'Y LABEL'のフォントがTimes New RomanかHiragino Kaku Gothic Proか区別が付かず、Times New Romanなのかな?と思ったのですが、実際のところどうなのでしょう。
x = 0:10:360; t = tiledlayout(2,1);
ax(1) = nexttile; plot(x,sind(x))
ax(2) = nexttile; plot(x,cosd(x))
l1 = ylabel(t,'Y LABEL'); l2 = ylabel(ax(1),'y label');
l1.FontName = 'TakaoMincho'; l2.FontName = 'TakaoMincho';
Yuya Akamatsu
Yuya Akamatsu am 28 Jan. 2022
コメントありがとうございます.
理由はわかりませんが,MATLABを2021bにアップデートしたところ,フォントを変更することができました.
ご協力くださりありがとうございました.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!