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

조회 수: 10 (최근 30일)
Simon
Simon 2023년 3월 19일
댓글: Star Strider 2023년 3월 21일
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