figureの軸ラベル内でlatexを使用する方法
Mostrar comentarios más antiguos
figureのY軸ラベルを以下のように表示させたいです。
「Volume fraction ε (%)」
・Volume fractionと(%)はフォントTimes New Romanの通常の文字
・イプシロンはlatexのギリシャ文字
以下のコードで軸ラベルを設定したのですが、「$\varepsilon$」の部分がそのまま表示されてしまいます。
ylabel("Volume fraction $\varepsilon$ (%)", "Interpreter", "latex", "FontName", "Times New Roman");
解決策ありましたら教えていただきたいです。
Respuestas (1)
交感神経優位なあかべぇ
el 16 de Dic. de 2025
文字列内の % がLatexのコメントアウトの % と認識され、かつ、コメントアウト非対応なためエラーになったのだと思います。\%でパーセントをエスケープしてあげると、表示されました。
ylabel("Volume fraction $\varepsilon$ (\%)", "Interpreter", "latex");
また、labelのLatexではFontNameは無視されるようですので、指定できません。(下記URLのInterpreterの欄に記載)
Categorías
Más información sobre ラベルと注釈 en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!