Menu

#1570 Uneven xtics when using timedata

closed-works-for-me
nobody
None
5
2015-03-23
2015-02-23
No

Hi,

if I use timedata for the x axis and set the xtics interval to something like 3 months I get some weird bumps in the xtics distribution: the tics are unevenly distributed.

I am attaching a test script.

The same unexpected behavior happens on either 4.6 or 5.1 from CVS (23 Feb 2015).

Thanks,
Antonio

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2015-02-23

    The program tries to round a total number of seconds to the nearest month boundary. This does not produce the result you probably want for at least two reasons:

    (1) The tic series should start evenly on your start date.
    Replace
    set xtics three_months
    with
    set xtics strptime("%Y-%m-%d","2010-01-01"), three_months

    (2) Your definition of three_months is not accurate and gradually accumulates rounding error. You would do better with
    one_year = 60 * 60 * 24 * 365.25
    three_months = one_year / 4

     

    Last edit: Ethan Merritt 2015-02-23
  • Antonio Ospite

    Antonio Ospite - 2015-02-24

    These solutions help a lot, thanks Ethan.

    I think the report can be closed.

     
  • Ethan Merritt

    Ethan Merritt - 2015-02-25
    • status: open --> closed-works-for-me
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.