TiledLayoutの軸ラベルのフォントを変更したい
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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'
l2.FontName = 'Times New Roman'
2 commentaires
Atsushi Ueno
le 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';
Réponses (0)
Voir également
Catégories
En savoir plus sur Axis Labels dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
