Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to insert textbox and write text in a figure by code (not manually)
Date: Thu, 16 Aug 2007 18:25:37 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 35
Message-ID: <fa24r1$k4h$1@fred.mathworks.com>
References: <fa1nue$lhh$1@fred.mathworks.com> <fa1qs8$83n$1@fred.mathworks.com> <fa23h9$t82$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1187288737 20625 172.30.248.37 (16 Aug 2007 18:25:37 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Aug 2007 18:25:37 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:424192


Jeff:
<SNIP wants to set his/her subplot axes manually...

> Can you set the position to a subplot index instead of a 
certain x,y location...

yes, but with limitations...

% look at this example
     pos=[
          .1,.1,.3,.3
          .4,.4,.3,.3
     ];
     subplot(2,2,[1,2]);
for  i=1:size(pos,1)
     subplot('position',pos(i,:));
     pause
end
% so - a new subplot removes all others underneath it...
% a better solution
% get pos of a subplot
     figure;
     sh=subplot(2,2,1);
     pos=[
          get(sh,'position')
          pos
     ];
     delete(sh); % not necessary...
     ah=zeros(size(pos,1),1);
for  i=1:size(pos,1)
     ah(i)=axes('position',pos(i,:));
end
     axes(ah(1)); % make axis one active...

us