Current figure text interpreter

64 ビュー (過去 30 日間)
jcd
jcd 2023 年 11 月 3 日
回答済み: Mario Malic 2023 年 11 月 3 日
I want to change the text interpreter of all the text (ticks, axis labels, legends, annotations, etc) in my current figure (saved as hFig = figure;) to LaTeX. Currently, I use
set(groot,...
'defaulttextinterpreter','latex',...
'defaultAxesTickLabelInterpreter','latex',...
'defaultLegendInterpreter','latex')
but I don't want to affect future figures. So far I can only modify the ticks in the current figure using
set(gca, 'TickLabelInterpreter', 'latex')
Is there a way to do it for every text shown in the current figure?

採用された回答

Mario Malic
Mario Malic 2023 年 11 月 3 日
Hi, here's an example
fig = figure();
subplot(2,1,1);
x = linspace(0,10);
y1 = sin(x);
plot(x,y1)
legend("ax_1");
subplot(2,1,2);
y2 = sin(5*x);
plot(x,y2)
legend("ax_2")
legH = findall(fig, "Type", "legend");
set(legH, "Interpreter", 'latex')
axesH = findall(fig, "Type", "axes");
set(axesH, "TickLabelInterpreter", 'latex')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by