From: Marcin Kolesinski on
dvt <dvt+usenet(a)psu.edu> wrote in message <gfcbor$109k$1(a)f04n12.cac.psu.edu>...
> Alan B wrote:
> > I am trying to customize the way that datatips are displayed in my
> > figure windows - for now all I want is to increase the number of
> > digits that are displayed. I tried to do this by right clicking on a
> > normal datatip, then "edit..." and "select..." to modify the text
> > update function. When I did that, it worked fine, but then I looked
> > at the ClickedCallback property of the datacursormode uitoggletool
> > object, and it was still set to "putdowntext('datatip',gcbo)", as it
> > was before I modified the text update function.
>
> What Steven said.
>
> I can add just a little to Steven's suggestion... an example of
> customizing "the way that datatips are displayed." Sometimes an example
> helps as much as an explanation, so here it is:
>
> http://www.mathworks.com/matlabcentral/fileexchange/18773
>
> --
> Dave
> dvt at psu dot edu


Here's a suggestion I found that worked:

You can define a custom function that is invoked whenever a figure is created, by default. This could even be done in an automated start-up script if you wish.

<code>
set(0,'DefaultFigureCreateFcn',@<function_name>)
</code>

This function can internally configure the datacursormode callback:

<code>
function <function_name>(src, evnt)
dcmObj = datacursormode(src);
set(dcmObj,'UpdateFcn',@<datatip_callback>);

<anything else you want to do or define for each new figure>
end
</code>