【问题标题】:How can I align subplot images with different size in matlab如何在matlab中对齐不同大小的子图图像
【发布时间】:2015-02-09 10:27:42
【问题描述】:

我用 Matlab 在图上绘制了三个子图像,如图 1 所示,您可以看到它们的标题和图像没有对齐。我想绘制一个图 2 或图 3,其中至少标题对齐。我怎样才能做到这一点?谢谢。

图 1

图 2

图 3

【问题讨论】:

  • 请在您的示例中添加代码。你在使用 MatLab'subplot' 命令吗?您使用哪个命令来呈现图像?

标签: matlab alignment subplot


【解决方案1】:

排序的答案是(据我所知)没有办法对齐子图。但是,您可以手动给出每个图像的确切位置和大小,这意味着您可以手动计算对齐的位置。

这将是这样的:

y = .8; % vertical location stays fixed

subplot('Position', [.1 y width1 height1]);
imagesc(img1);
title('1');

[s1 s2] = size(img2);
subplot('Position', [.4 y width2 height2]);
imagesc(img2);
title('2');

[s1 s2] = size(img3);
subplot('Position', [.7 y width3 height3]);
imagesc(img3);
title('3');

【讨论】:

  • 没看懂,请举个具体例子。谢谢。
  • 谢谢,但这不是我想要的答案。
猜你喜欢
  • 1970-01-01
  • 2012-10-08
  • 2013-03-26
  • 2011-08-11
  • 2012-10-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多