figureの軸ラベル内でlatexを使用する方法
Afficher commentaires plus anciens
figureのY軸ラベルを以下のように表示させたいです。
「Volume fraction ε (%)」
・Volume fractionと(%)はフォントTimes New Romanの通常の文字
・イプシロンはlatexのギリシャ文字
以下のコードで軸ラベルを設定したのですが、「$\varepsilon$」の部分がそのまま表示されてしまいます。
ylabel("Volume fraction $\varepsilon$ (%)", "Interpreter", "latex", "FontName", "Times New Roman");
解決策ありましたら教えていただきたいです。
Réponses (1)
交感神経優位なあかべぇ
le 16 Déc 2025
文字列内の % がLatexのコメントアウトの % と認識され、かつ、コメントアウト非対応なためエラーになったのだと思います。\%でパーセントをエスケープしてあげると、表示されました。
ylabel("Volume fraction $\varepsilon$ (\%)", "Interpreter", "latex");
また、labelのLatexではFontNameは無視されるようですので、指定できません。(下記URLのInterpreterの欄に記載)
Catégories
En savoir plus sur ラベルと注釈 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!