Doug's MATLAB Video Tutorials

February 25th, 2011

Creating a custom data cursor

This video shows how to make a custom data cursor so that when you click on a data point, it will show you the information you want about that data. Also, this video demonstrates a technique for using varargin to pass inputs from one function to another.

Get Adobe Flash player .

4 Responses to “Creating a custom data cursor”

  1. oleg replied on :

    There’s just one problem with datacursormode on: http://www.mathworks.com/matlabcentral/answers/2005-windowkeypressfcn-and-datacursormode-on

    Oleg

  2. bob replied on :

    How do you make a custom data cursor function?

    I’d like to be able to return the data cursor position to my other functions

  3. dhull replied on :

    @bob,

    That is what the video is about. What do you mean?

  4. bob replied on :

    Ok, I figured it out.

    Made the figure handle visible to other callbacks.
    Had to edit the data-tip update function to pass in the handle to the figure (since it’s not a callback).
    Then setappdata the data-tip-position in the update-function using the figure handle.

    And voila, can access data-tip-position in other callbacks of my GUI.

    That’s what I meant. Couldn’t get getCursorInfo to work properly.

    Anyway, cool video, it helped point me in the right direction.

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


MathWorks

Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.

Doug's picture

These postings are the author's and don't necessarily represent the opinions of The MathWorks.