凡例の繰り返しにおける特殊文字(斜体)について
古いコメントを表示
基本的な質問で失礼いたします.
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!


