ytickforma​t('percent​age') not working with latex interpreter

16 次查看(过去 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!

采纳的回答

Star Strider
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 CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by