help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Time Formatted Plot Problem


From: Fritz Sonnichsen
Subject: Simple Time Formatted Plot Problem
Date: Fri, 2 Mar 2018 11:14:30 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

I have played with this for a while. I have been able to plot time series data in the past but now something has gone wrong. I have distilled the problem into the short stretch of code below. The data plots without specifying the time axis, but when I add the time formatted axis it look find but the data does not appear.
  Any ideas?
Thanks
Fritz
======================= CODE ===========================
1;
clear all
fflush(stdin);

xtme=["12:20:39";"12:20:41";"12:20:42";"12:20:43";"12:20:44"];
xT=[    1      ;2       ;3       ;4       ;5];


plot(xT)
figure
timeFormat='HH:MM:SS';
xdatenum=datenum(xtme,timeFormat); %days from January 0, 0000
xlen = length(xtme);
plot(xdatenum,xT,'color','r');
datetick('x',timeFormat,'keepticks')
axis([0 xlen 0  10])
    return




reply via email to

[Prev in Thread] Current Thread [Next in Thread]