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