How to use latex interpreter for xticklabels?

490 vues (au cours des 30 derniers jours)
Mr M.
Mr M. le 27 Juin 2017
Commenté : Dima le 22 Déc 2024
How to use latex interpreter for xticklabels or yticklabels?

Réponse acceptée

Adam
Adam le 27 Juin 2017
Modifié(e) : Adam le 27 Juin 2017
hAxes.TickLabelInterpreter = 'latex';
assuming you are using >= R2014b, where hAxes is your axes handle
  1 commentaire
Dima
Dima le 22 Déc 2024
set(gca,"TickLabelInterpreter",'latex')

Connectez-vous pour commenter.

Plus de réponses (2)

Stefan Ineichen
Stefan Ineichen le 13 Nov 2018
Modifié(e) : Stefan Ineichen le 13 Nov 2018
Insert the code before plotting.
set(groot,'defaultAxesTickLabelInterpreter','latex');
Further, add these to set other useful interpreter to latex.
set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex');
  1 commentaire
krishna teja
krishna teja le 28 Jan 2019
is there a way to change default font size for axes tick labels?

Connectez-vous pour commenter.


Ali Afruzi
Ali Afruzi le 13 Avr 2022
You can set 'latex' or 'tex' for only one of your axis plot.
Using TickLabelInterpreter, one can define latex for only x-axis and tex for y-axis. for example:
x=1:10;
y=rand(10,1);
plot(x,y)
xaxisproperties= get(gca, 'XAxis');
xaxisproperties.TickLabelInterpreter = 'latex'; % latex for x-axis
yaxisproperties= get(gca, 'YAxis');
yaxisproperties.TickLabelInterpreter = 'tex'; % tex for y-axis

Community Treasure Hunt

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

Start Hunting!

Translated by