Filter löschen
Filter löschen

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

16 Ansichten (letzte 30 Tage)
Simon
Simon am 19 Mär. 2023
Kommentiert: Star Strider am 21 Mär. 2023
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!

Akzeptierte Antwort

Star Strider
Star Strider am 19 Mär. 2023
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.
.

Weitere Antworten (0)

Tags

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by