azuric
azuric

Reputation: 2839

gnuplot using time series csv data

I am trying to plot the price data against time from a csv file 'data.csv' in the format:

DateTime,Price,Size
2015-04-16 07:49:24.335,129.68,248
2015-04-16 07:49:24.385,129.68,278
2015-04-16 07:49:24.435,129.68,182
2015-04-16 07:49:25.485,129.68,2
2015-04-16 07:49:26.235,129.68,20

however i am trying this:

set xdata time
set timefmt '%Y%m%d %H:%M:%S'
plot "G:\\data.csv" using 0:2 notitle with lines

and getting the wrong chart. I have tried using the user guide to no avail

Can anyone help?

Upvotes: 0

Views: 1513

Answers (1)

Christoph
Christoph

Reputation: 48440

Two things: Column numbering starts at 1, and you must tell gnuplot to use comma as column separators:

set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set datafile separator ','
plot "G:\\data.csv" using 1:2 notitle with lines

Upvotes: 2

Related Questions