Path: news.mathworks.com!not-for-mail
From: "Shanmugam Kannappan" <shanmugambe@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: subplot transpose
Date: Thu, 9 Jul 2009 19:16:02 +0000 (UTC)
Organization: Tata Elxsi
Lines: 31
Message-ID: <h35fli$5us$1@fred.mathworks.com>
References: <h35cvr$63s$1@fred.mathworks.com>
Reply-To: "Shanmugam Kannappan" <shanmugambe@gmail.com>
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 1247166962 6108 172.30.248.35 (9 Jul 2009 19:16:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Jul 2009 19:16:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1441885
Xref: news.mathworks.com comp.soft-sys.matlab:554217


"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h35cvr$63s$1@fred.mathworks.com>...
> for i=1:25
>     subplot(5,5,i);
>     differences=rand(1,6) ;    bar(differences);    title(i);
> end
> 
> If you run that code above you'll notice that the numbers run from top left corner, to the right, and then down to the next row and to the right again.
> 
> If want them running from top left corner DOWN to the to bottom left, then up to the first row of the next column again.
> 
> Basically I want the transpose of the digram that is generated by the code above.
> 
> Is there  a way ??
> 
> Thanks
> xoxo

Hi,

By default subplot works in row wise but if you need to have in column wise
You can do this way.....
idx = reshape(1:25,5,[])'
idx=idx(:);
for i=1:25
    subplot(5,5,idx(i));
    differences=rand(1,6) ; bar(differences); title(i);
end

Hope this helps .....

Shan......