我想标签我使用LaTeX的情节。我有两个问题:我的标题不会显示,我需要将文本添加到LaTeX表达式中。理想情况下,我想它来标记我的身材“对于不同的n值F(X)”,但不是“F(X)”我想这一点:Matlab图标题w/LaTeX没有出现?
如何添加“对于我的LaTeX表达式中的n“部分的不同值,更重要的是,为什么我的标题没有出现在第一位呢?
这里是我的脚本:
x = linspace(0, 1, 100);
y1 = sin(pi*x);
y2 = sin(2*pi*x);
y3 = sin(4*pi*x);
hold on
plot(x,y1,'color',1/255*[255 20 147],'LineWidth',2);
plot(x,y2,'color',1/255*[0 238 118],'LineWidth',2);
plot(x,y3,'color',1/255*[0 238 238],'LineWidth',2);
xlabel('\theta','FontSize',15);
ylabel('$f_{s}(\theta)$','Interpreter','LaTex','FontSize',15);
title('$f_{s}(\theta)=\sin (n\theta\pi)$','Interpreter','LaTex',FontSize',18);
legend('n = 1', 'n = 2', 'n = 4','Location','best')
hold off
在你的机器上还缺少'title'中的'FontSize'之前是否缺少''''字符? – zeeMonkeez
只是一个评论:虽然'\ theta'看起来没问题,但我也会将它放在Latex中,以保持一致性。 – zdim