我怎样才能让我的情节看起来更漂亮(包括字体、标签等)?

How can I make my plots look prettier (including fonts, label, etc )?

我正在尝试为我的演示文稿获取非常好的图,下面是我用来绘制的代码

clear all 
clc
close all
syms v   
omegat= -2:0.000001:2;

Nt=32;
gainfuc = (1/Nt)*exp(1i*pi*omegat*(Nt-1)/2).*sin(pi*Nt*omegat/2)./sin(pi*omegat/2);
gainfuc(omegat == 0) = 1;
G = (omegat < 2/Nt).*(omegat > -2/Nt);
plot(omegat,abs(gainfuc))
syms t
hold on
grid on
plot(omegat,G,'r')
ylabel('G_t(y)','FontSize',16,'FontWeight','bold')
xlabel('y','FontSize',16,'FontWeight','bold')

我的问题很简单,有什么想法可以让这个图更漂亮(字体、网格等...)以便在演示文稿中看起来更漂亮?

更新 根据下面的答案

修改后得到如下图

在Matlab中2014b一个新的graphic engine got introduced,立马好看了

New default colormap presents data more accurately, making it easier to interpret. New default line colors, fonts, and styles with anti-aliased graphics and fonts improve the clarity and aesthetics of MATLAB visualizations.

在 Matlab 2014a 中,您还可以通过以下 instructions.

激活新的图形引擎

较早的版本中,破解也是可能的,但我还没有测试过。这很可能是错误的。对于 2014a,我已经使用了将近一年,它的效果非常好。我找不到与 2014b 中 HG2 最终版本的任何差异。


确保平滑设置为 'on'

h = gcf;
h.GraphicsSmoothing = 'on'

我还使用了标准的 LateX 字体 CMU Serif Roman 来为所有内容增添趣味。安装字体(开源)后,在代码开头输入此行。

set(0,'defaultAxesFontName', 'CMU Serif Roman')
set(0,'defaultAxesFontSize', 12)

一般建议:

  • 使用矢量图形渲染:set(gcf, 'renderer', 'painters')
  • 保存绘图时指定分辨率,尤其是像素图形:print('-dpng','-r600','PeaksSurface')(仍然使用矢量渲染器!)
  • MS Office 的矢量格式是 .emf,Matlab 也支持
  • 可以使用:set(gcf,'InvertHardcopy','off')