From: radar on
My data is datetime, value pairs. I don't need to see the date, but the seeing time on the x axis is critcal.

The times are discrete minute intervals (5 minutes) with the first being 07:30:00 and the next 07:35:00 and so on.

How do I plot the x axis to show those times? Thanks.
From: Steven Lord on

"radar" <lcaruso(a)tds.net> wrote in message
news:1838057187.105544.1273522908414.JavaMail.root(a)gallium.mathforum.org...
> My data is datetime, value pairs. I don't need to see the date, but the
> seeing time on the x axis is critcal.
>
> The times are discrete minute intervals (5 minutes) with the first being
> 07:30:00 and the next 07:35:00 and so on.
>
> How do I plot the x axis to show those times? Thanks.

Look at the DATETICK function.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: radar on
Thanks.

The only problem is the axis is too crowded with labeling.

Is there anyway to get the labels vertical instead of horizontal?
From: radar on
How can I get the datetime to display in time format in a timeseries object?

It's just shows the datenum which is useless. Thanks.
From: radar on
I tried editing the callback to show a datestr instead of a datenum, but this didn't work. Any suggestions?

function output_txt = myfunction(obj,event_obj)
% Display the position of the data cursor
% obj Currently not used (empty)
% event_obj Handle to event object
% output_txt Data cursor text string (string or cell array of strings).

pos = get(event_obj,'Position');
output_txt = {['X: ',datestr(pos(1),4)],...
['Y: ',num2str(pos(2),4)]};

% If there is a Z-coordinate in the position, display it as well
if length(pos) > 2
output_txt{end+1} = ['Z: ',num2str(pos(3),4)];
end