close all;
clear all;
clc;
figure;
x = [0 10 20 30 40 50];
y1 = [11 22 33 44 55 66 ];
y2 = [22 33 44 55 66 77 ];
plot(x,y1,'-*',x,y2,'->');
axis([0,85,5,90]);
set(gca, 'XTick', [0 15 30 45 60 75]);
xlabel('噪声比例(%)','fontsize',12, 'FontWeight', 'bold');
ylabel('识别率(%)','fontsize',12, 'FontWeight', 'bold');
legend('aa','bb');
title('画图标题');
% set(gca,'position',[left bottom width height])
% 设置坐标轴在figure内的大小和位置
% The left and bottom elements define the distance from the lower-left corner of the container to the lower-left corner of the axes.
% left和bottom定义从坐标轴的左下角到container(坐标轴的包含者或者说包含坐标轴的容器)左下角的距离。
% The width and height elements are the axes dimensions.
% width和height是坐标轴的尺寸。
% By default, the values are measured in units normalized to the container.
% 默认情况下,left、bottom、width、height的值是单位化的,参考者是container;left、bottom、width、height的去值均在0到1之间。
clear all;
clc;
figure;
x = [0 10 20 30 40 50];
y1 = [11 22 33 44 55 66 ];
y2 = [22 33 44 55 66 77 ];
plot(x,y1,'-*',x,y2,'->');
axis([0,85,5,90]);
set(gca, 'XTick', [0 15 30 45 60 75]);
xlabel('噪声比例(%)','fontsize',12, 'FontWeight', 'bold');
ylabel('识别率(%)','fontsize',12, 'FontWeight', 'bold');
legend('aa','bb');
title('画图标题');
% set(gca,'position',[left bottom width height])
% 设置坐标轴在figure内的大小和位置
% The left and bottom elements define the distance from the lower-left corner of the container to the lower-left corner of the axes.
% left和bottom定义从坐标轴的左下角到container(坐标轴的包含者或者说包含坐标轴的容器)左下角的距离。
% The width and height elements are the axes dimensions.
% width和height是坐标轴的尺寸。
% By default, the values are measured in units normalized to the container.
% 默认情况下,left、bottom、width、height的值是单位化的,参考者是container;left、bottom、width、height的去值均在0到1之间。
set(gca,'position',[0.09 0.1 0.88 0.83]);
准确地说这里应该是通过调整坐标轴的位置和尺寸来达到去掉空白边缘的目的。