如何减少matlab中子图的边框?
在 Matlab 中,子图周围浪费了大量空间。例如,在此示例中:
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% 的空间被浪费为“空白” 我想缩小空白空间,但未能成功找到一种机制来做到这一点。想法?
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
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
文件交换上的
subaxis
功能允许您指定边距对于子图。用法示例:
The
subaxis
function on the File Exchange allows you to specify margins for subplots.Example usage:
您可以使用自己(或以编程方式)定位它们。
默认情况下,坐标是标准化的。所以一个位置
[0.1 0.1 0.5 0.5] 将从 10% 处开始
从左下角开始,宽度等于
为图形宽度的一半,高度等于图形的一半
人物高度。
请参阅已接受的答案,了解边距和填充的内置解决方案。
You can position them yourself (or programatically) using
By default, the coordinates are normalized. So a position
of [0.1 0.1 0.5 0.5] will start at 10% of the way in
from the lower left corner, and will have a width equal
to half the figure width, and a height equal to half the
figure height.
See the accepted answer for a built-in solution to margins and padding.
尝试减少隐藏轴
LooseInsets
属性中的默认值,如 http://UndocumentedMatlab.com/blog/axes-looseinset-property/例如:
Try to reduce the default values in the hidden axes
LooseInsets
property, as described in http://UndocumentedMatlab.com/blog/axes-looseinset-property/For example: