我是靠谱客的博主 单薄自行车,这篇文章主要介绍Matlab 画图 去白框单个图去白框示例图 一行两列子图示例图,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
figure set(gcf,'unit','centimeters','Position',[30 12 8 6]);% 在屏幕(30,12)处显示8cm*6cm图窗 grid('on') % 网格 默认关 title('fontname{宋体}FileName') % 标题 title('FileName','FontName','宋体') % 等效标题代码 legend('fontname{宋体}FileName1','fontname{宋体}FileName2' ,'Location','best','Box','off');% 图例 xlabel('fontsize{10.5}fontname{Times New Roman}itx/rmmm'); % x标签 it 斜体 ylabel('fontsize{10.5}fontname{Times New Roman}itw/rmmm'); % y标签 rm 正体 set(gca,'FontName','Times New Roman','FontSize',10.5); % 字体字号 %% 一个图去白框 (四个代码差不多,推荐使用第四个) set(gca,'LooseInset',[0 0 0 0]); set(gca,'LooseInset',get(gca,'TightInset')); set(gca,'LooseInset',[0 0 0 0],'OuterPosition',[0 0 1 1]); ax=gca;ax.OuterPosition=[0 0 1 1];Ti=ax.TightInset;Ti(Ti<.005)=.005; ax.Position=ax.OuterPosition+[Ti([1 2]),- Ti(1) - Ti(3),- Ti(2) - Ti(4)]; %% 1行2列子图去白框示例 %左边下边空隙为0,长度0.5 高度1 set(gca,'LooseInset',[0 0 0 0],'OuterPosition',[0 0 0.5 1]); %左边空隙为0.5,下边空隙为0,长度0,495(有的时候设置为0.5在打印时右边图框边没了) 高度1 set(gca,'LooseInset',[0 0 0 0],'OuterPosition',[0.5 0 0.495 1]); % 等效去白框代码 set(gca,'LooseInset',get(gca,'TightInset'),'OuterPosition',[0 0 0.5 1]); set(gca,'LooseInset',get(gca,'TightInset'),'OuterPosition',[0.5 0 0.495 1]); ax=gca;ax.OuterPosition=[0 0 0.5 1];Ti=ax.TightInset;Ti(Ti<.005)=.005; ax.Position=ax.OuterPosition+[Ti([1 2]),- Ti(1) - Ti(3),- Ti(2) - Ti(4)]; ax=gca;ax.OuterPosition=[0.5 0 0.5 1];Ti=ax.TightInset;Ti(Ti<.005)=.005; ax.Position=ax.OuterPosition+[Ti([1 2]),- Ti(1) - Ti(3),- Ti(2) - Ti(4)]; %% 打印 print('FileName','-dmeta') % '-dsvg' '-dmeta' 打印 矢量图 print('FileName','-dpng','-r600') % '-dpng' 打印 600 dpi 位图 %% 打印去白框,但图片比例不再是8:6 exportgraphics(gcf,'FileName.emf','ContentType','vector');% 打印 矢量图 (去白框) exportgraphics(gcf,'FileName.png','Resolution',600); % 打印 600 dpi 位图 (去白框)

单个图去白框示例图

 一行两列子图示例图

最后

以上就是单薄自行车最近收集整理的关于Matlab 画图 去白框单个图去白框示例图 一行两列子图示例图的全部内容,更多相关Matlab内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部