help-octave
[Top][All Lists]
Advanced

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

Re: Problem plotting time on X axis


From: Fritz Sonnichsen
Subject: Re: Problem plotting time on X axis
Date: Thu, 15 Feb 2018 09:34:54 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

thanks for responding--See Ian's post--that fixed the problem-I was not seeing any plot line despite the fact that the X labels looked appropriate.
Fritz

On 2/14/2018 5:32 PM, Przemek Klosowski wrote:
On 02/14/2018 03:08 PM, Fritz Sonnichsen wrote:
On 2/14/2018 2:25 PM, Przemek Klosowski wrote:
On 02/14/2018 02:00 PM, Fritz Sonnichsen wrote:
ser_date=datenum(dtmeT,timeFormat); %serial date is secs since 1/1/0000
  plot(ser_date,T ,'color','k'  );
  datetick('x',timeFormat,'keepticks')
  xlen = length(dtmeT)  ;
axis([0 xlen 20 35])

I think it's a manifestation of the magnitude bug in the default toolkit (fltk?). The problem is that fltk can't plot intervals that have a short span compared to the magnitude of the endpoints. Since you don't seem to care about the actual date, resetting the beginning to midnight works around that:

plot(ser_date-datenum("00:00:00"),T ,'color','k' )
I tried that and it did not work. My "ser_date" is numbers like: 7.3706e+005

Right--you have to do the whole thing of course, including setting the datetick.

dtmeT = {"9:00:38" "9:00:39" "9:00:40" "9:00:41"}
T = [   23.900    23.900   22.900   21.100]
timeFormat='HH:MM:SS';
  ser_date=datenum(dtmeT,timeFormat); %serial date is secs since 1/1/0000
plot(ser_date-datenum("00:00:00"),T ,'color','k' )
datetick('x',timeFormat,'keepticks')

In general, it's easier for everyone if you ask questions by providing a complete, standalone example that can run in a fresh Octave session. I just copied-and-pasted the above snippet and got an expected graph---what exactly is happening in your case?


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------




reply via email to

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