Greek letters Latex interpreter

15 次查看(过去 30 天)
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.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by