Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Displaying grid of images
Date: Mon, 23 Mar 2009 08:34:01 +0000 (UTC)
Organization: Helbling Technik Bern AG
Lines: 29
Message-ID: <gq7hhp$qa4$1@fred.mathworks.com>
References: <gq7016$a24$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237797241 26948 172.30.248.35 (23 Mar 2009 08:34:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 23 Mar 2009 08:34:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1271984
Xref: news.mathworks.com comp.soft-sys.matlab:526859


"Yaroslav Bulatov" <yaroslavvb@gmail.com> wrote in message <gq7016$a24$1@fred.mathworks.com>...
> How can I display a grid of images with no space between the images? I've tried subplot->imshow->subplotspace, but it's hard to get it to leave no space, and it's very slow to execute

This will look terrible, but it's the only thing I can think of:

generate arrays for the X and Y coordinates of your points. Then, make surface plots of each image in the same axes, shifting the X and Y arrays to reach the desired position in the grid.

If you use a gray colorscale, and orient the representation correctly, you'll obtain your grid of images.

e.g.:

% A = 640 x 480 x n x m array of images

x = 1:640;
y = 1:480;

[X, Y] = meshgrid(x,y)

figure
colorscale(grey)
view([0 90])

for i=0:n-1
  for j=0:m-1
    surf(X+i*640, Y+j*480, A(:,:,i,j));
  end
end

Consider it as pseudocode, I haven't tested it. And again, while this will work, I'm not at all sure it will be faster!