Plot time on x axis with timeseries

2 views (last 30 days)
maurilio
maurilio on 7 Nov 2013
Dear, I have a problem with plot timeseries, I would like to see on the x-axis the time with this code:
%%%**************************************************************************************************
tsC = timeseries(1, 1, 'name', 'Var1');
tsC.TimeInfo.StartDate = date; % Set start date.
tsC.TimeInfo.Format = 'HH:MM:SS PM';
tsC.TimeInfo.Units = 'minutes';
tsC.Time = tsC.Time-tsC.Time(1);
tsC1 = timeseries(1, 1, 'name', 'Var2');
tsC1.TimeInfo.StartDate = date; % Set start date.
tsC1.TimeInfo.Format = 'HH:MM:SS PM';
tsC1.TimeInfo.Units = 'minutes';
tsC1.Time = tsC1.Time-tsC1.Time(1);
p0 = plot(h1,tsC.Data,tsC.Time,tsC1.Data,tsC1.Time);
set(p0(1), {'YData'}, {tsC.Data}, {'XData'}, {tsC.Time});
set(p0(1),'Color',[1,0,0])
set(p0(2), {'YData'}, {tsC1.Data}, {'XData'}, {tsC1.Time});
set(p0(2),'Color',[0,1,0])
%%%********************************************************************************************************
so: my problem is that I would plot the time on the X axis and not a relative number but I try to use Datetick but is not working!!
thanks for your helpful advice!! Regards MD

Answers (0)

Categories

Find more on Two y-axis in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!