1

I have a file with several fields:

$ cat report.txt 
2014-04-18T14:21:19 41 33
2014-04-21T02:01:35 42 36
2014-05-14T16:47:58 36 57
2014-05-19T01:01:30 37 58
2014-05-23T01:25:06 41 59
2014-07-23T11:54:48 34 76

I would like to render a graph from it using gnuplot, presented like:

So basically

  • X-axis: Field 1 (before the T)
  • Y-Axis: Values from fields 2 and 3
  • Blue: Value of field 2
  • Red: Value of field 3

I miss basic understanding of gnuplot on how to do this. I've read the manpage, some online documentation and examples but still can't figure out how to do a simple graph like this.

1
  • I edited the title to reflect what your question was, hope you agree. And I didn't check the colors in my answer, but thats not hard to achieve. Commented Jul 23, 2014 at 14:00

1 Answer 1

2

This shall do it (tested with 4.6):

set xdata time
set yrange [0:70]

# input date format
set timefmt "%Y-%m-%dT%H:%M:%S"

# output date format
set format x "%Y\n%m-%d"

plot \
    'report.txt' using 1:2 with lines ti "col 2", \
    'report.txt' using 1:3 with lines ti "col 3"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.