代码之家  ›  专栏  ›  技术社区  ›  Rui Nian

无法将Matlab Y轴转换为LaTex格式

  •  0
  • Rui Nian  · 技术社区  · 7 年前

    我最近开始使用matlab进行一些原型设计。我喜欢用乳胶字体制作轴,因为它和我的其他作品是一致的。我使用了以下代码:

    figure()
    plot(t, y(:, 1), t, y1, '--r')
    legend('Transfer Function', 'State Space', 'Interpreter', 'latex');
    xlabel('Time, \textit{t} (s)', 'Interpreter', 'latex');
    ylabel('%MeOH in Distillate, \textit{X_D} (%)', 'Interpreter', 'latex');
    

    通过这样做,我得到了我的X轴和乳胶格式的图例。但是,我的Y轴不是乳胶格式的。我想知道这是为什么。

    enter image description here

    谢谢!

    1 回复  |  直到 7 年前
        1
  •  3
  •   Sardar Usama Francesco.s    7 年前

    你把一些乳胶语法搞乱了。请参见突出显示的更改:

    ylabel('\%MeOH in Distillate, \textit{$X_D$} (\%)', 'Interpreter', 'latex');
    %       ^                             ^   ^   ^
    

    output