Greek letters Latex interpreter

15 vues (au cours des 30 derniers jours)
Francesco Marchione
Francesco Marchione le 23 Juil 2021
Réponse apportée : Rik le 23 Juil 2021
I have the following code to plot the 2D graph:
T1 = readtable('PROVA GRAFICI.xlsx', 'VariableNamingRule','preserve')
figure
plot(T1.('x/L'), T1.('tau (MPa)'), '-r', T1.('x/L_1'), T1.('tau (MPa)_1'),':k',T1.('x/L_2'), T1.('tau (MPa)_2'),'k', 'LineWidth',0.7)
grid
xlim([-1 1])
ylim([-6 6])
ylabelname = sprintf('Load [N]','${D_{i}}$' );
ylabel(ylabelname, 'fontsize', 11, 'interpreter', 'latex')
set(gca,'xticklabel',num2str(get(gca,'xtick')','%.2f'))
L=legend('ADH1','ADH2','ADH3', 'Location','best');
set(L,'Interpreter','latex')
set(gca,'TickLabelInterpreter','latex')
xlabel(sprintf('Displacement [mm]','${D_{i}}$'), 'Interpreter','latex')
ylabel(sprintf('Shear stress [MPa]','${D_{i}}$'), 'Interpreter','latex')
In the y axis, I would like to write tau instead of "Shear stress", using LaTeX interpreter. I do not know hot to do this.
Could you help me please?
Thank you.

Réponse acceptée

Rik
Rik le 23 Juil 2021
You need to turn math mode on:
plot(rand(10,2));
ylabel('Shear stress $\tau$ [MPa]', 'fontsize', 11, 'interpreter', 'latex')

Plus de réponses (0)

Catégories

En savoir plus sur Labels and Annotations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by