MATLAB: How to enable data cursors on the time series plot in MATLAB 7.7 (R2008b)

financialMATLAB

I create a plot of my time series through the TSTOOL function. The figure window does not have a button for adding data cursors.

Best Answer

There is no way to enable data cursors through the Time Series Plots graphical interface.
As a workaround, use DATACURSORMODE at the command line. First find all (even hidden) figures:
set(0,'showhiddenhandles','on');
h = findobj(0, 'type', 'figure');
set(0,'showhiddenhandles','off');
Find which handle corresponds to the Time Series Plots window. This can be found by looking at the 'Name' property of each handle:
get(h, 'name')
ans =
'Time plot: View1'
'Time Series Tools'
In this case h(1) is the correct figure window to use. Now enable data cursors for this figure window using DATACURSORMODE:
datacursormode(h(1), 'on');