Loading ...
Sorry, an error occurred while loading the content.

RE: [ploticus] seconds lost on datetime stubs - rounding problem in DT_days2datetime (dates.c)

Expand Messages
  • Stephen Grubb
    Thanks for finding this issue and providing a fix... this fix will be present in next release. -Steve ________________________________________ From:
    Message 1 of 2 , Oct 10, 2008
    • 0 Attachment
      Thanks for finding this issue and providing a fix... this fix will be present in next release. -Steve

      ________________________________________
      From: ploticus@yahoogroups.com [ploticus@yahoogroups.com] On Behalf Of treykinkead [treykinkead@...]
      Sent: Monday, October 06, 2008 6:15 PM
      To: ploticus@yahoogroups.com
      Subject: [ploticus] seconds lost on datetime stubs - rounding problem in DT_days2datetime (dates.c)

      Hi,

      Ploticus rocks, but I'm having an issue...

      I'm creating timeline style blots (proc bars) from datetime data and
      finding that the stubs seem to placed correctly, but the time
      component in their text wrongly has "00" for the seconds.

      I believe that DT_days2datetime (dates.c) is to blame -- it seems to
      be rounding to the nearest minute. My fix was:

      diff dates.c.orig dates.c
      1425c1425
      < timepart = floor( timepart + 0.5 ); /* remove any rounding error
      introduced by above */
      ---
      > timepart = floor( timepart*60.0 + 0.5 ) / 60.0; /* remove any
      rounding error introduced by above */

      And my test script:
      #proc getdata
      data:
      A 2008-10-01.18:00:24 2008-10-01.18:02:24
      B 2008-10-01.18:00:24 2008-10-01.18:03:00
      C 2008-10-01.18:01:54 2008-10-01.18:05:24
      D 2008-10-01.18:03:00 2008-10-01.18:05:24

      #proc areadef
      rectangle: 1 1 5 3
      xscaletype: datetime yyyy-mm-dd.hh:mm:ss
      xrange: 2008-10-01.18:00:24 2008-10-01.18:06:00
      yscaletype: categories
      ycategories: datafield 1

      #proc xaxis
      stubs: incremental 1 minute
      stubformat: hh:mm:ss
      stubrange: 2008-10-01.18:00:24
      grid: color=blue
      minorticinc: 0.1minute

      #proc yaxis
      stubs: categories
      grid: color=gray(0.9)

      #proc bars
      color: green
      barwidth: 0.05
      horizontalbars: yes
      segmentfields: 2 3
      locfield: 1
      labelfield: 2

      If I'm missing something, please let me know.

      cheers,
      /trey
    Your message has been successfully submitted and would be delivered to recipients shortly.