0

I am working with gnuplot to show simple data on a graph.

My datafile (output.csv) looks like this:

14:06,30.947
14:07,34.476

The first column is time the second column is data. To get this out in a graph i used these commands in gnuplot:

set timefmt "%H:%M"
set xdata time
set datafile separator ','
plot "output2.csv" using 1:2 with lines

Now when i do this my graph looks like this: enter image description here

Now as you can see my x axis only takes the minutes not the hours. Why does this happen?

Cyber_Star
  • 903
  • 1
  • 9
  • 27

1 Answers1

1

The set timefmt command only tells gnuplot the format of your input data. To specify the time format of the x axis, you need to add

set format x "%H:%M"

So

set xdata time
set timefmt "%H:%M"
set format x "%H:%M"
set datafile separator ','
plot "output2.csv" using 1:2 with lines

enter image description here

steeldriver
  • 136,215
  • 21
  • 243
  • 336