Greek letters Latex interpreter

12 visualizaciones (últimos 30 días)
Francesco Marchione
Francesco Marchione el 23 de Jul. de 2021
Respondida: Rik el 23 de Jul. de 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.

Respuesta aceptada

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

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by