Current figure text interpreter
108 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
0 Kommentare
Akzeptierte Antwort
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')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!