フィルターのクリア

how to unify LaTex font and default font in plot

16 ビュー (過去 30 日間)
Maggie liu
Maggie liu 2021 年 7 月 7 日
コメント済み: Maggie liu 2021 年 7 月 14 日
How can I make sure that the fonts in my plot is the same?
I would like to have everything be in Heventica (or at least everything without math symbols be in Heventica), but once I use 'interpreter','latex', everything inside will become Times. Is there a way to either change the font of latex script, or have math symbols font be seperated from normal text?
This is what I have now
title('some title')
xlabel('$\int L_{data} - L_{sim}$','Interpreter','latex')
ylabel('Normalized counts')

採用された回答

Tanay Gupta
Tanay Gupta 2021 年 7 月 13 日
編集済み: Tanay Gupta 2021 年 7 月 13 日
Hi @Maggie liu, according to my understanding setting the default font to Helvetica does not influence the font used by the 'latex' interpreter. It isn't possible to specify Helvetica as the font for the LaTeX interpreter.
Since you mentioned that you would like to separate math symbols from text, you can use the following code for the same.
fontname = 'Helvetica ';
set(0,'defaultaxesfontname',fontname);
x = [2 4 7 2 4 5 2 5 1 4];
bar(x);
saveas(gcf,'Barchart','epsc')
label2 = '\int L_{data} - L_{sim}';
xlabel(label2);
ylabel('This is my y-label');
I hope it helps.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by