function [] = correct_figure()
zM = zoom(gcf);
set(zM, 'ActionPostCallback', ...
@(figh, eventobj) set(eventobj.Axes, 'XTickLabel', ...
sprintf('%d|', get(eventobj.Axes, 'XTick'))));
pN = pan(gcf);
set(pN, 'ActionPostCallback', ...
@(figh, eventobj) set(eventobj.Axes, 'XTickLabel', ...
sprintf('%d|', get(eventobj.Axes, 'XTick'))));
fig=gcf;
dcm_obj = datacursormode(fig);
set(dcm_obj,'UpdateFcn',@myupdatefcn)
function [txt] = myupdatefcn(empt,eventdata)
pos = get(eventdata,'Position');
txt = {['Sample: ',num2str(pos(1))],...
['Value: ',num2str(pos(2))]};
end
end