Changing Legend Font Using Latex Interpreter

Hi,
I want to change the font style of legend using Latex interpreter. I have tried using
h=legend('M1, {$\it{p_{\mathrm{s}}}$}=\rm{1}, Num.','M1, $\it{p_{\mathrm{s}}}$=\rm{1}, Sim.','M1, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Num.','M1, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Sim.','M2, $\it{p_{\mathrm{s}}}$=\rm{1}, Num.','M2, $\it{p_{\mathrm{s}}}$=\rm{1}, Sim.','M2, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Num.','M2, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Sim.','Location','NorthWest');
set(h, 'Interpreter', 'LaTex','Fontname','Times New Roman','Fontsize',16);
But it does not work. Font style changes to default Latex style.
I will be thankful for your support.

7 件のコメント

Adam Danz
Adam Danz 2019 年 6 月 29 日
編集済み: Adam Danz 2019 年 6 月 29 日
Ameer Ahmed
Ameer Ahmed 2019 年 6 月 30 日
Hi Adam
Thanks for sharing a link but unfortunately, i did not find any useful information related to my problem. I am using variables in legend with subscript. I want to change whole legend and subscript to roman font style except the variable which i want italic.
I will be oblidged if someone could help me.
Adam Danz
Adam Danz 2019 年 6 月 30 日
If that link didn't address your quesiton, then I don't understand your question. If the goal is to use latex in your legend and to change the font, that's what the link addresses.
Ameer Ahmed
Ameer Ahmed 2019 年 7 月 1 日
編集済み: Ameer Ahmed 2019 年 7 月 2 日
Hi! When i use this code for a legend, Font style of the egend is changed. I want it Time new roman but it is a different font style.
h=legend('M1, {$\it{p_{\mathrm{s}}}$}=\rm{1}, Num.','M1, $\it{p_{\mathrm{s}}}$=\rm{1}, Sim.','M1, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Num.','M1, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Sim.','M2, $\it{p_{\mathrm{s}}}$=\rm{1}, Num.','M2, $\it{p_{\mathrm{s}}}$=\rm{1}, Sim.','M2, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Num.','M2, $\it{p_{\mathrm{s}}}$=\rm{0.9}, Sim.','Location','NorthWest');
set(h, 'Interpreter', 'LaTex','Fontname','Times New Roman','Fontsize',16);
I don't know whether Latex interpreter supports Times new roman style or not.
Adam Danz
Adam Danz 2019 年 7 月 1 日
In sort, matlab does not have a method of chaning font if you're using latex. There are undocumented ways that are explained in the link I provided.
Ameer Ahmed
Ameer Ahmed 2019 年 7 月 2 日
None of them worked in my case.
Adam Danz
Adam Danz 2019 年 7 月 2 日
Looks like there's no known solution, then.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLabels and Annotations についてさらに検索

製品

リリース

R2013b

質問済み:

2019 年 6 月 29 日

コメント済み:

2019 年 7 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by