Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
linking two graphs

Subject: linking two graphs

From: bram derks

Date: 17 Aug, 2009 07:50:17

Message: 1 of 3

Dear,

I would like to do the following:

Suppose I have two graphs of two different functions of two variables.
The functions are related in the sense that the domain of one is a (linear) transformation of the other.

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.
Is this possible?

Maybe start with a simplification where both domains are the same?

Any help would be much appreciated.
Bram

Subject: linking two graphs

From: Paul Mennen

Date: 17 Aug, 2009 16:28:03

Message: 2 of 3

"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

Subject: linking two graphs

From: bram derks

Date: 24 Aug, 2009 09:15:20

Message: 3 of 3

Dear Paul,

Thans for your reply.
I checked plt function and I must see it looks great!
It is intended for 2D applications. Is any extension to 3D foreseen?

Bram

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us