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:
Creating Datatips with additional information

Subject: Creating Datatips with additional information

From: Michael

Date: 20 Dec, 2012 19:08:08

Message: 1 of 2

So I have more information I would like to display in the datatip cursor than what I want to plot. I have an 8-dimensional array and only want the plot the first two dimenstions, but want the rest information displayed in the datatip cursor.

Example:
data(:,1) = x_vals
data(:,2) = y_vals
data(:,3) = z_vals
data(:,4) = pressure_vals
data(:,5) = temp_vals
... etc.

Plot the following line:
plot(data(:,1),data(:,2);

What I want the cursor to display at i_th location along the line:
'X: data(i,1) \n'
'Y: data(i,2) \n'
'Z: data(i,3) \n'
'P: data(i,4) \n'
'T: data(i,5) \n'
... etc.

How would I do this? Thx.

Subject: Creating Datatips with additional information

From: Steven_Lord

Date: 31 Dec, 2012 06:14:03

Message: 2 of 2



"Michael " <mbouey@asu.edu> wrote in message
news:kavnmo$7c0$1@newscl01ah.mathworks.com...
> So I have more information I would like to display in the datatip cursor
> than what I want to plot. I have an 8-dimensional array and only want the
> plot the first two dimenstions, but want the rest information displayed in
> the datatip cursor.

*snip*

> What I want the cursor to display at i_th location along the line:
> 'X: data(i,1) \n'
> 'Y: data(i,2) \n'
> 'Z: data(i,3) \n'
> 'P: data(i,4) \n'
> 'T: data(i,5) \n'
> ... etc.
>
> How would I do this? Thx.

Create an UpdateFcn for use with DATACURSORMODE and include the additional
information in the UpdateFcn. See the last section of the Examples on this
documentation page for an example that does this.

http://www.mathworks.com/help/matlab/ref/datacursormode.html

Use the techniques described here to pass the additional information into
your UpdateFcn.

http://www.mathworks.com/help/matlab/math/parameterizing-functions.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

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