MATLAB: Datatip

data cursordatatipgui

Hello!
I have a question regarding datatip on my GUI graph. Everytime I run my GUI and select Data Cursor I have to right click on graph and select my datatip file. The graph opens up the default one(X : xxxx, Y : yyyy). Mine shows date and mass. It's just a bit annoying opening up everytime… Can I change this by making it default for this GUI file?
Thank you in advance!

Best Answer

I assume you have your data tip function, you can set it when you enable the data cursor mode.
%%Original data
f=figure;
h=plot(rand(10,1));
dcm=datacursormode(f);
datacursormode on;
set(dcm,'updatefcn',@MyDataTipFunction);