|
From: | Przemek Klosowski |
Subject: | Re: Problem plotting time on X axis |
Date: | Wed, 14 Feb 2018 17:32:34 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 02/14/2018 03:08 PM, Fritz Sonnichsen wrote:
On 2/14/2018 2:25 PM, Przemek Klosowski wrote:I tried that and it did not work. My "ser_date" is numbers like: 7.3706e+005On 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' )
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?
[Prev in Thread] | Current Thread | [Next in Thread] |