Reputation: 3036
How i able to plot this in gnuplot the following times in gnuplot?
But the graph does not seem to adapt the hours after the days.
set timefmt "%jd %H:%M"
in my test.csv there is:
0,1d 10:15
1,1d 10:05
2,1d 1:50
3,2d 3:30
As seen in the picture the time is not plotted correctly.
Upvotes: 1
Views: 69
Reputation: 25734
You have to tell gnuplot that your data separator is comma. Per default it is whitespace.
In the example below skip the $Data
datablock and in the plot command replace $Data
by Test.csv
.
There, column2 is plotted versus column1. Maybe you want it the other way round, it's not clear from your question, graph and plot command.
Code:
### plotting time data
reset session
$Data <<EOD
0,1d 10:15
1,1d 10:05
2,1d 1:50
3,2d 3:30
EOD
set datafile separator comma
myTimeFmt = "%jd %H:%M"
set format y myTimeFmt time
plot $Data u 1:(timecolumn(2,myTimeFmt)) w lp pt 7 notitle
### end of code
Result:
Upvotes: 2