Path: news.mathworks.com!not-for-mail
From: "Paul Mennen" <nospam@mennen.org>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linking two graphs
Date: Mon, 17 Aug 2009 16:28:03 +0000 (UTC)
Organization: Sigknowledge
Lines: 8
Message-ID: <h6c0ej$3ri$1@fred.mathworks.com>
References: <h6b23p$m4m$1@fred.mathworks.com>
Reply-To: "Paul Mennen" <nospam@mennen.org>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250526483 3954 172.30.248.38 (17 Aug 2009 16:28:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 17 Aug 2009 16:28:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869812
Xref: news.mathworks.com comp.soft-sys.matlab:563998


"bram derks" wrote 
> I would like to plot both in a different window, 'walk' through the domain
> in one graph (with the datacursor) and see a datacursor appear at the
> function values of the second function in its (transformed) domain. 

I believe the plot alternative "plt" found in the file exchange (search for "plt") will help since it data cursors are more sophisticated. Look at the example "demo\tasplt.m" since it does something similar to what you want. Two plots are created. Moving the cursor in plot 1 will also move the corresponding cursor in plot 2 (and visa versa) to keep them synchronized. The last 3 lines of the routine accomplish this feat. It's even simpler if you don't need the "visa versa" part. In that example the domains of the two graphs are the same, however since it synchronizes with respect to the index, the code will work as well with different domains as in your situation.

~Paul