2012-04-04 75 views
4

我試圖讓3個圖像並排顯示在matlab中。但是當我使用副劇場時,他們正在被不均勻地分開。第一張和第二張是25x25像,第三張是25x75像。獲取圖像在matlab中並排顯示

我怎樣才能得到它是像顯示

+-----++-----++---------------+ 
| img || img ||  img  | 
| 1 || 2 ||  3  | 
+-----++-----++---------------+ 

回答

8

您可以使用subplot跨越多個方格。對於示例嘗試

subplot(1,4,1) 
subplot(1,4,2) 
subplot(1,4,3:4) % this will expand the third axes over the last two grid squares 

注:

軸的位置可以h=subplot(...)返回的句柄新創建軸。然後,您可以使用set調整軸也可以在圖中使用

h=subplot('position', [left bottom width height]) 

手動放置軸。此外,請注意功能get(h,'prop')set(h,'prop',value)也可用於調整其他軸屬性。有關所有可用屬性的文檔,請參見MATHWORK的handle graphics browser軸部分。

+0

它像一個魅力,但我有兩個問題,圖像出現變色,有沒有一種方法,我可以讓他們幾乎接觸? – cubearth 2012-04-04 16:53:25

+0

@cubearth查看我的答案更新以調整子區位置。不知道圖像顏色發生了什麼。需要更多的信息來幫助你。 – Azim 2012-04-04 17:07:36

4

另一種方法是創建一個新的圖像:

abuttedImage = [im1 im2 im3]; 

這將工作,只要每個圖像中的行的數目是相同的。