Matlab layout using LaTeX

General use of Latex

Generally, graphic Matlab commands, such as commands title, legend, xaxis, … (except XTickLabel and YTickLabel, see below), accept Latex commands:
t=title('une fen\^etre Matlab avec une fraction: $\frac{3}{2}$');
set(t,'Interpreteur','Latex');

Quotes and single quotes

A single quote can be used by doubling the single quote:
title('l''apostrophe dans le titre d''une figure Matlab');

Latex and XTickLabel & YTickLabel

XTickLabel and YTickLabel don't accept LaTex commands.
One have to cope, for instance with text command which enable writting text wherever desired inside a figure, and which accept Latex…
text(x,y,str)
where x and y are coordinates where to put the text (according to the current scale, cf. axis), and str is the text itself (string).
Avantage is that Latex can be freely used (and also many other things, see help text):
text(x,y,str,'interpreter','LaTex');
A comprehensive list of options and parameters can be found there: behavior and apparence properties of text function.

Functions XTickLabel.m and YTickLabel.m can be uesd to do this.
Script test_XYlabels.m is an use example of these functions. It leads to the following polts:

Exemple d'utilisation de la fonction XY Labels Deuxième exemple d'utilisation de la fonction XY Labels

See also
Haut de la page Lien