I think I understand how to customize the existing data tip to the extent it is described in this Mathworks video. But what I want to do is display other related data values for the selected point on the figure.
For example, I can show the position (x,y,z), but I would like to show the time associated with the plot at that position.
In addition, I have several sets plotted on the same figure. Each call to the plot function returns a separate handle, so the individual plots are organized in a hierarchical data structure, keeping each entity separate.
I want the custom data tip to display values related to its data set, like an ID value for that set, for example.
Is there a way to determine the handle for the plot associated with the selected data point (that the data tip is referring to)?
UPDATE
I notice that there is a field in the plot called "UserData" that I can attach my data to. Is there a way, maybe, to reach this data from the Data Tip update function?
UPDATE 2
I can see that the datatip callback is passed a handle called "event_obj". This is a structure with a "Target" and "Position" field. The Position is just the x,y,z position on the figure. The Target is another structure where I can see my UserData structure is located. It also contains the arrays for the x,y and z values for every data point in that plot set. What I need now is the index for the datapoint referred to by the datatip. Then I think I can do the rest with my UserData.