TeX markup ignored by Matlab?

11 visualizaciones (últimos 30 días)
francesco capirci
francesco capirci el 27 de Abr. de 2018
Comentada: Kevin Joshi el 1 de Jun. de 2020
I'm trying to format a prompt text using the TeX markup. This always worked with my old Matlab version (r2016a) but recently i updated to r2018a. Since then any time i try a modifier or a character sequence, it gets printed as is: for example, \pi is printed as "\pi" with the backslash included. Same goes with modifiers like ^{} and _{}. Even my old codes, which used to work, don't anymore. Any ideas?
  2 comentarios
Holden Tranquillo
Holden Tranquillo el 29 de Abr. de 2020
I'm having the same issue
BAHIDJ Ryadh
BAHIDJ Ryadh el 1 de Jun. de 2020
Try adding the parameters 'interpreter', 'tex' for commands like title, xlabel ... etc. MATLAB command line however doesn't support tex/LaTex Markup or greek characters according to Mathworks support because of the character set it is using.

Iniciar sesión para comentar.

Respuestas (1)

Kevin Joshi
Kevin Joshi el 1 de Jun. de 2020
Please use this as plot lables
clc;
clear all;
x = 1:100
y = rand(1,100)
plot(x,y)
xlabel({'\pi'},'interpreter','tex')
ylabel({'{\pi_{j}^{k}}'},'interpreter','tex')

Categorías

Más información sobre Labels and Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by