龙听期货论坛's Archiver

C
+
+


 微信: QQ:

龙听 发表于 2019-5-10 14:30

matlab画图设置图片大小以及线宽和字号命令

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

[color=#494949][font=simsun][size=14px][color=#ED1C24]另外,在把图片另存为emf格式的时候,需要在导出选项中更改字体的大小,否则会导出为默认的字体大小,如下图所示[/color][/size][/font][/color]
[color=#494949][font=simsun][size=14px][color=#ED1C24][url=http://album.sina.com.cn/pic/6288b226zx6CvLn3viC36][img=0,397]http://s7.sinaimg.cn/mw690/6288b226zx6CvLn3viC36&690[/img][/url]
[/color][/size][/font][/color]

页: [1]