Current figure text interpreter

108 Ansichten (letzte 30 Tage)
jcd
jcd am 3 Nov. 2023
Beantwortet: Mario Malic am 3 Nov. 2023
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?

Akzeptierte Antwort

Mario Malic
Mario Malic am 3 Nov. 2023
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')

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by