ytickformat('percentage') not working with latex interpreter
10 次查看(过去 30 天)
显示 更早的评论
I want to use ytickformat('percentage') in my figures.
In these figures I've set the defaultAxesTickLabelInterpreter to latex since I want to include these figures in a latex report. If I set the interpreter, the values on the yaxis dissapear completely. How can I solve this?
The following code:
figure(1)
plot(1:100)
ytickformat('percentage')
figure(2)
% This is the command I use at the beginning of my actual code to set the interpreter for all axes.
set(groot, 'defaultAxesTickLabelInterpreter','latex');
plot(1:100)
ytickformat('percentage')
Produces these two figures:
This is on R2022a
Thanks!
0 个评论
采纳的回答
Star Strider
2023-3-19
This:
ytickformat('$%g \\%%$')
seems to work —
figure(1)
plot(1:100)
ytickformat('percentage')
figure(2)
% This is the command I use at the beginning of my actual code to set the interpreter for all axes.
set(groot, 'defaultAxesTickLabelInterpreter','latex');
plot(1:100)
ytickformat('$%g \\%%$')
MATLAB doesn’t recognise all the LaTeX format options, so the one in the LaTeX documentation did not work.
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!