凡例の繰り返しにおける特殊文字(斜体)について
Show older comments
基本的な質問で失礼いたします.
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)
Accepted Answer
More Answers (0)
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


