Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#148 Setting range fails in time plot

None
closed
None
5
2014-01-16
2012-10-03
Craig DeForest
No

See the copypasta below.

Here I plot a two-point line from early 2007 to late 2012, using UNIX time format. It works fine, until I try to explicitly set the X range. I set it to the same UNIX time values as the domain of the plot, which should be a NO-OP. But instead it sets the plotted time range to 7/2037 to 7/2042, which is (to say the least) incorrect.

--------------------

[dhcp-10-72:~] zowie% gnuplot

G N U P L O T
Version 4.6 patchlevel 0 last modified 2012-03-04
Build System: Darwin x86_64

Copyright (C) 1986-1993, 1998, 2004, 2007-2012
Thomas Williams, Colin Kelley and many others

gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')

Terminal type set to 'aqua'
gnuplot> set terminal dumb
Terminal type set to 'dumb'
Options are 'feed size 79, 24'
gnuplot> set timefmt "%s"
gnuplot> set xdata time
gnuplot> set xtics format "%m/%Y"
gnuplot> plot '-' using 1:2 notitle with lines
input data ('e' ends) > 1.1754288e9 1
input data ('e' ends) > 1.3438224e9 11
input data ('e' ends) > e

12 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ + + + + + + + + + + + +
| *** |
10 ++ **** ++
| **** |
| **** |
8 ++ **** ++
| **** |
| **** |
6 ++ ***** ++
| **** |
| **** |
| **** |
4 ++ **** ++
| **** |
| **** |
2 ++ **** ++
| *** |
+ + + + + + + + + + + + +
0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01/20077/20071/2008/20081/20097/20091/20107/20101/2011/20111/20127/20121/2013

gnuplot> set xrange [1175428800:1343822400]
gnuplot> plot '-' using 1:2 notitle with lines
input data ('e' ends) > 1.1754288e9 1
input data ('e' ends) > 1.3438224e9 11
input data ('e' ends) > e
^
all points y value undefined!
gnuplot> set yrange [0:12]
gnuplot> plot '-' using 1:2 notitle with lines
input data ('e' ends) > 1.1754288e9 1
input data ('e' ends) > 1.3438224d9 11
input data ('e' ends) > e

12 +++++-++++++++++++-++++++++++-+++++++++++-++++++++++-+++++++++++-++++++
| + + + + + + + + + + +|
| |
10 ++ ++
| |
| |
8 ++ ++
| |
| |
6 ++ ++
| |
| |
| |
4 ++ ++
| |
| |
2 ++ ++
| |
| + + + + + + + + + + +|
0 +++++-++++++++++++-++++++++++-+++++++++++-++++++++++-+++++++++++-++++++
07/203701/20387/203801/203907/20391/204007/20401/204107/20411/204207/2042

gnuplot>

Discussion

  • That's no bug.

    All range specifications for time/date axes should be in 'quotes', and follow the same format as the actual input data. I.e. this:

    set xrange [1175428800:1343822400]

    should instead be written like this:

    set xrange ['1175428800':'1343822400']

    If you want to specify the range without quotes around the numbers, you'll have to subtract the 30 years of difference between Unix epoch time and gnuplot's internal representation yourself.

     
    • labels: 102065 -->
    • assigned_to: nobody --> broeker
    • status: open --> pending-invalid
     
  • Ethan Merritt
    Ethan Merritt
    2014-01-16

    • status: pending-invalid --> closed
    • Group: -->