I need to plot the data with the xaxis labeled in the form %H:%M

Viewed 40

I have some data that looks like this...

2014-02-15T07:41:43.700000Z,2.75145690372,340.539828373,-34.7917070474 2014-02-15T07:42:33.700000Z,2.73724365914,350.052331172,-35.718172353 2014-02-15T07:43:23.700000Z,4.17392058542,340.821919563,-35.7187246344 2014-02-15T07:44:13.700000Z,3.84482455783,341.7388175,-33.2515578256 2014-02-15T07:45:03.700000Z,3.92381331718,335.383453598,-34.4777171998 2014-02-15T07:45:53.700000Z,2.91617559082,345.152148599,-36.2501749961 2014-02-15T07:46:43.700000Z,2.55101019003,343.27796633,-25.2374589747

The first column is the datetime in one of the iso formats

I need to plot the data with the xaxis labeled in the form %H:%M

one example of what I've tried is

set xdata time
set format x "%H:%M"  
set timefmt "%Y-%m-%dT%H:%M:%SZ"

but I can't get anything to work... maybe the decimal seconds is wrong? Can anyone help?

1 Answers

Is your data really wrapped as shown, with a new date separated by a space rather than a newline? Gnuplot can't deal with that. But assuming the wrapping is an artifact from pasting into the question here and that the real data starts with a date in the first column of each line, your time format works for me here. You do need to tell gnuplot that the data fields are separated by a comma (*.csv format).

set xdata time
set format x "%H:%M" 
set timefmt "%Y-%m-%dT%H:%M:%SZ"
set datafile separator comma

plot 'data' using 1:2

enter image description here

Related