Path: news.mathworks.com!not-for-mail
From: "Daphne " <daphnew_too_nospam@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Datatip (Datacursormode)
Date: Sun, 11 May 2008 11:48:03 +0000 (UTC)
Organization: Technion
Lines: 42
Message-ID: <g06mdj$9ad$1@fred.mathworks.com>
References: <g00qvj$4gu$1@fred.mathworks.com> <g016ot$gva$1@fred.mathworks.com> <g02208$r3i$1@fred.mathworks.com> <g02in1$mhk$1@fred.mathworks.com> <g03lef$c19$1@fred.mathworks.com> <g05nbr$kdi$1@fred.mathworks.com>
Reply-To: "Daphne " <daphnew_too_nospam@yahoo.com>
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 1210506483 9549 172.30.248.37 (11 May 2008 11:48:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 11 May 2008 11:48:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1066798
Xref: news.mathworks.com comp.soft-sys.matlab:467780



Well, the hack works really well for now. 
Thanks for taking this on. The entire lab is grateful!

Daphne


"helper " <spamless@nospam.com> wrote in message 
<g05nbr$kdi$1@fred.mathworks.com>...
> "Daphne " <daphnew_too_nospam@yahoo.com> wrote in 
message 
> <g03lef$c19$1@fred.mathworks.com>...
> > 
> > This works great. Thanks!
> > 
> > Another small question. What I want to do, now the the 
> > datatips are plotted, is let the user change their 
> > locations manually, if needed. However, when I set the 
> > datacursormode to on, and try to move one of the 
> datatips, 
> > it doesn't move to the next point on the plot, but 
falls 
> > to the first one. Any ideas? 
> > 
> 
> OK, I've added one more line to the 2nd FOR-loop.  I'll 
dig 
> more and try to find the ideal way to actually do all of 
> this rather than this hack.
> 
> I = [3 8];
> for n = 1:length(I)
>   h(n) = createDatatip(hDC, hPlot);
> end
> drawnow
> for n = 1:length(I)
>   set(h(n),'Position',[X(I(n)) Y(I(n))],...
>     'String',sprintf('X: %s\nY: %s',...
>     num2str(X(I(n))),num2str(Y(I(n)))));
>    set(get(h(n),'DataCursor'),'DataIndex',I(n))
> end