###### Expressing Youself Using Code

Even you are small, you have a chance to fight!

## 程序演示

for i = 1:4
% plot a figure
figure;
x = normrnd(0, 3, [100, 3]);
hist(x);
legend({'$C_1$', '$C_2$', '$C_3$'}, 'Interpreter', 'latex', 'Location', 'NorthEast');
xlabel('\textbf{Variabel} $x$', 'Interpreter', 'latex');
ylabel('\textbf{Count}', 'Interpreter', 'latex');
title(['Figure ', num2str(i)]);

% specify figure size
af = gcf;
af.Position(3) = af.Position(3)*0.7;
af.Position(4) = af.Position(4)*0.5;

% expand axes to fill figure
ax = gca;
outerpos = ax.OuterPosition;
ti = ax.TightInset;
left = outerpos(1) + ti(1);
bottom = outerpos(2) + ti(2);
ax_width = outerpos(3) - ti(1) - ti(3);
ax_height = outerpos(4) - ti(2) - ti(4);
ax.Position = [left bottom ax_width ax_height];

% Specify Page Size
af.PaperPositionMode = 'auto';
fig_pos = af.PaperPosition;
af.PaperSize = [fig_pos(3) fig_pos(4)];

% save the figure
print(af, ['Figure_', num2str(i), '.png'], '-dpng');
end

#### matlab figure被图像填充

2017-12-29 15:23:29

#### 图像显示—关于MATLAB里显示.mat形式的图像

2017-12-14 09:07:16

#### MATLAB中GUI的使用技巧（1）之axes

2017-06-09 15:02:42

#### 【Matlab】关于axes和figure对象的关系

2016-01-05 14:59:39

#### 用Matlab生成适用于期刊及会议的图形- plot

2012-11-03 00:27:44

#### Matlab中axes函数解析

2016-03-09 19:09:41

#### matlab中axes用法

2015-05-07 01:18:13

#### Matlab axes的使用

2009-10-13 17:53:00

#### matlab 从figure获得axes

2016-10-30 03:06:32

#### Matlab---在多个axes之间切换

2016-03-25 20:00:20

## 不良信息举报

[Matlab] 如何将axes填充整个Figure