Board logo

标题: matlab画图设置图片大小以及线宽和字号命令 [打印本页]

作者: 龙听    时间: 2019-5-10 14:30     标题: matlab画图设置图片大小以及线宽和字号命令

set(gcf,'Units','centimeters','Position',[10 10 7 5]);%设置图片大小为7cm×5cm
%get hanlde to current axis返回当前图形的当前坐标轴的句柄,
%(the first element is the relative distance of the axes to the left edge of the figure,...
%the second the vertical distance from the bottom, and then the width and height;
set(gca,'Position',[.13 .17 .80 .74]);%设置xy轴在图片中占的比例
set(get(gca,'XLabel'),'FontSize',8);%图上文字为8 point或小5号
set(get(gca,'YLabel'),'FontSize',8);
set(get(gca,'TITLE'),'FontSize',8);
set(gca,'fontsize',8);
set(gca,'linewidth',0.5); %坐标线粗0.5磅
set(gca,'box','off');%Controls the box around the plotting area
set(get(gca,'Children'),'linewidth',1.5);%设置图中线宽1.5磅

另外,在把图片另存为emf格式的时候,需要在导出选项中更改字体的大小,否则会导出为默认的字体大小,如下图所示






欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2