去掉matlab中figure图的空白边缘

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之间。

set(gca,'position',[0.09 0.1 0.88 0.83]);


准确地说这里应该是通过调整坐标轴的位置和尺寸来达到去掉空白边缘的目的。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值