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

조회 수: 10 (최근 30일)
Yuya Akamatsu
Yuya Akamatsu 2022년 1월 10일
댓글: Yuya Akamatsu 2022년 1월 28일
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
Atsushi Ueno
Atsushi Ueno 2022년 1월 10일
同じプログラムで'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 2022년 1월 28일
コメントありがとうございます.
理由はわかりませんが,MATLABを2021bにアップデートしたところ,フォントを変更することができました.
ご協力くださりありがとうございました.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!