如何在Matlab中缩小子图周围的边界? [英] How to reduce the borders around subplots in matlab?

查看:149
本文介绍了如何在Matlab中缩小子图周围的边界?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
MATLAB子图边距

Possible Duplicate:
MATLAB subplot margin

在matlab中,子图周围浪费了过多的空间.例如,在此示例中:

In matlab, an inordinate amount of space is wasted around subplots. For example, in this example:

t = 0:0.001:2*pi+0.001;
figure(2);
for i = 1 : 25;
    subplot(5,5,i);
    plot(t, sin(i*t));
    axis off
end

该图上超过50%的空间被浪费为空白",我想缩小该空白空间,但是未能找到一种实现此目的的机制.有想法吗?

over 50% of the space on the figure is wasted as "blank" I'd like to shrink that blank space down, but have been unsuccessful to identify a mechanism to do so. Thoughts?

谢谢 约翰

推荐答案

subaxis 函数允许您指定子图的边距.

The subaxis function on the File Exchange allows you to specify margins for subplots.

示例用法:

t = 0:0.001:2*pi+0.001;
figure(2);
for i = 1 : 25;
    subaxis(5,5,i, 'Spacing', 0.03, 'Padding', 0, 'Margin', 0);
    plot(t, sin(i*t));
    axis tight
    axis off
end

这篇关于如何在Matlab中缩小子图周围的边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆