Hello,
I am trying to modify my data cursor when plotting with a datetime axis. However, when I apply a custom function to a datacursor's updatefcn, the variable retreived for position doesn't reflect the axis position in datetime format:
My current code is from the older non-Tex callbacks:
function output_txt = myfunction(obj,event_obj)
pos = get(event_obj,'Position');
output_txt = {['X: ',num2str(pos(1),10)],...
['Y: ',num2str(pos(2),10)]};
if length(pos) > 2
output_txt{end+1} = ['Z: ',num2str(pos(3),10)];
end
The values for event_obj.Position(1) = 5.3139 which I do not know how to convert to datetime. I've tried the approach from this answer and then converted my axis formatting using the datetick function but the ticks do not adjust accordingly when zoomed. I would like to have a datatimeRuler with a callback function on the cursor. Thanks in advance.