如下代码将绘制一幅y=sin(x)的图片,
%adjust default figure properties to improve quality figure; set(gcf,... 'DefaultLineLineWidth',1,'DefaultAxesLineWidth',.5,... 'DefaultAxesFontName','Helvetica',... 'DefaultAxesFontSize',20,... 'DefaultAxesTickLength',[0.02,0.02],... 'DefaultAxesXMinorTick','on','DefaultAxesYMinorTick','on'); set(gcf,'DefaultLineMarkerSize',8); % plot your data here x=0:0.3:2*pi; y=sin(x); plot(x,y,'o-','displayname','$y=\sin (x)$'); xlabel('$x$','interpreter','latex'); ylabel('$y$','interpreter','latex'); h=legend('show'); set(h,'interpreter','latex'); title('http://asc.2dark.org'); %save your figure and export to eps format hgsave('example.fig'); print('-depsc','example.eps');

如要绘制坐标轴紧邻的子图,使用默认的subplot是无法实现的,需要手动设置子图坐标的位置。比如要绘制三幅相连的子图,可以
x=0:0.3:2*pi; figure; h1=subplot(1,3,1); plot(x,sin(x)); h2=subplot(1,3,2); plot(x,cos(x)); h3=subplot(1,3,3); plot(x,sin(x-1)); set(h1,'position',[0.1,0.1,0.26,0.8]); set(h2,'position',[0.36,0.1,0.26,0.8],'yticklabel',''); set(h3,'position',[0.62,0.1,0.26,0.8],'yaxislocation','right');
补充:似乎不是compiz的问题,完全删除latex-xft-fonts软件包然后注销重新登录即可。还可参考Matlab Central中的讨论
评论