凡例の繰り返しにおける特殊文字(斜体)について
显示 更早的评论
基本的な質問で失礼いたします.
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)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


