凡例の繰り返しにおける特殊文字(斜体)について
Mostrar comentarios más antiguos
基本的な質問で失礼いたします.
y=tanh(kx),kは定数で,これを変化させたグラフをを一つの図上にまとめようとしてこのようなコードを書きましたが,凡例のkのみを斜体にしようとしたのにもかかわらず,変数部分までも斜体になってしまいます.
なにかいい手立てはありませんか?
%y=tanh(kx)のグラフ
x = linspace(-5,5,10000);
for i = 1:10
yi = tanh(i*x);
txt = [' \it{k} =',num2str(i)];
plot(x,yi,'DisplayName',txt,'LineWidth',1)
hold on
end
hold off
legend('FontSize',20,'Interpreter','latex')
xlabel('$$x$$','Interpreter','latex','FontSize',20)
ylabel('$$y$$','Interpreter','latex','FontSize',20)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Legend en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


