#1210 Cannot call functions in plot when 'set xdata time'

closed-works-for-me
nobody
None
5
2015-03-23
2013-02-19
No
$ cat > /tmp/plot
print "==> first test: "
reset
set xdata time
set timefmt "%Y%m%d%H%M%S"
plot "-" using 1:2 with linespoints
20130101000000 0
e

print "==> second test: "
reset
f(x) = x
set xdata time
set timefmt "%Y%m%d%H%M%S"
plot "-" using (f($1)):2 with linespoints
20130101000000 0
e
^D
$ gnuplot

    G N U P L O T
    Version 4.6 patchlevel 1    last modified 2012-09-26 
    Build System: OpenBSD amd64

    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 'x11'
gnuplot> load '/tmp/plot'
==> first test: 
Warning: empty x range [4.10314e+08:4.10314e+08], adjusting to [4.0621e+08:4.14417e+08]
Warning: empty y range [0:0], adjusting to [-1:1]
==> second test: 
Warning: empty x range [2.01301e+13:2.01301e+13], adjusting to [1.99288e+13:2.03314e+13]
Warning: empty y range [0:0], adjusting to [-1:1]
     "/tmp/plot", line 16: warning: time value out of range
     "/tmp/plot", line 16: warning: time value out of range
     "/tmp/plot", line 16: warning: time value out of range
     "/tmp/plot", line 16: warning: time value out of range
     "/tmp/plot", line 16: warning: Too many axis ticks requested (>6e+05)
gnuplot>

Discussion

  • Ethan Merritt

    Ethan Merritt - 2013-02-19

    You cannot use $1 to refer to a string containing formatted time/date information.

    If there are no spaces in the string (which looks to be the case in your example) then you may be able to use stringcolumn(1) instead. Otherwise no, you cannot use the column(), stringcolumn(), or $ function operators to parse time/date input.

     
  • Ethan Merritt

    Ethan Merritt - 2013-02-19
    • status: open --> open-invalid
     
  • Abel Abraham Camarillo Ojeda

    Yeah, I figured this later, and I'm currently parsing the data using stringcolumn().

    Thank you.

     
  • Ethan Merritt

    Ethan Merritt - 2013-04-08
    • status: open-invalid --> closed-works-for-me
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks