Hi,
I have written a code to have a data tip with higher resolution. Please find the sample below:
% Get Screensize
scrsz = get(groot,'ScreenSize');% Create a figure
fh =figure('Position',[10 10 scrsz(3)/1.1 scrsz(4)/1.1]);plot(rand(1,100)) DataCursorMode1 = datacursormode(fh);% Call the custom update function
set(DataCursorMode1,'Enable','on','UpdateFcn',@displayCoordinates)% Save the Matlab figure
savefig(fh,[Path '.fig']); % Close the figure
close (fh);
The custom update function is shown below:
function txt = displayCoordinates(~, info) txt = {sprintf('X: %.5f', info.Position(1)), sprintf('Y: %.5f', info.Position(2))};end
The Matlab figure is being saved in a shared drive. When i open it in my computer the data tip is shown as expected(with higher resolution).
But when somebody tries to open it in a different computer(with the same Matlab version 2018a). The data tip doesn't work anymore. It gives the following error on the figure:
Unable to update data tip using custom update function
I don't understand what is going wrong here. Does anybody have any clue? Appreciate your time and help.
Best Answer