From help-request at octave dot org Tue Jan 4 11:09:25 2005 Subject: Re: Plotting many images on one figure From: Etienne Grossmann To: Daniel =?iso-8859-1?Q?D=E9chelotte?= Cc: help at octave dot org, etienne@cs.uky.edu Date: Tue, 4 Jan 2005 12:05:17 -0500 Salut Daniel, what about a 280x280 image? foo = zeros(10*siz); for i = 1:100 m = floor((i-1)/10); n = rem(i-1,10); foo(m*siz+[1:sz],n*siz+[1:sz]) = reshape(everything(i,:), siz, siz)'; end image(foo); Hth, Etienne On Tue, Jan 04, 2005 at 04:40:09PM +0100, Daniel Déchelotte wrote: # Hi, # # I would like to draw, say, a 10 by 10 grid of images, each of which is a 28 # by 28 pixel, gray-level image. I couldn't get imshow() or image() to # display anything, I could only get saveimage generate a ppm image (PS seems # broken), and I can not see how I could arrange several of these images into # one figure. # # Below: # "siz" is 28 # "everything" is a [N, siz * siz] array (N = 100) # The following statement writes the first image in a ppm file: # saveimage("test.ppm", reshape(everything(1,:), siz, siz)',... # "ppm", colormap(gray(256))) # # A Matlab(r) script I would like to port to octave: # nlines = 10; # ncolumns = 10; # for i=1:nlines * ncolumns, # subplot(nlines, ncolumns, i); # colormap(gray(256)); # image(reshape(everything(i,:), siz, siz)'); # end # # I am afraid I already know the answer (not possible), but I wouldn't like # to miss a solution if one exists. I am running octave2.0.17-8 but could be # using octave2.1.60-1 if that helps, on Linux (Debian sarge). # # Regards, # -- # Daniel Déchelotte # http://yo.dan.free.fr/ # # # # ------------------------------------------------------------- # Octave is freely available under the terms of the GNU GPL. # # Octave's home on the web: http://www.octave.org # How to fund new projects: http://www.octave.org/funding.html # Subscription information: http://www.octave.org/archive.html # ------------------------------------------------------------- # -- Etienne Grossmann ------ http://www.cs.uky.edu/~etienne ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------