2015-02-09 80 views
0

我已經用matlab繪製出三幅子圖像,如圖1所示,您可以看到它們的標題和圖像未排成一行。我想繪製一個圖,如圖2或3所示,其中至少標題是對齊的。我怎樣才能做到這一點?謝謝。如何在matlab中對齊不同大小的子圖圖像

圖1 Matlab subplots

圖2 Matlab aligned subplots2

圖3 Matlab aligned subplots1

+0

請代碼添加到您的例子。你在使用MatLab的'subplot'命令嗎?你使用哪個命令來顯示圖像? – codekitty 2015-02-10 22:25:38

回答

0

排序的答案是,有沒有辦法(據我所知)對齊次要情節。但是,您可以手動給出每個圖像的確切位置和大小,這意味着您可以手動計算對齊的位置。

這將是沿着這些路線的東西:

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'); 
+0

我不明白,請舉個具體的例子。謝謝。 – neouyghur 2015-02-09 21:04:37

+0

謝謝,但這不是我想要的答案。 – neouyghur 2015-02-11 19:25:51