0
votes

I have a data file with 7 columns in which I need to draw the first column versus 4th, 5th, 6th and 7th column. The data file looks like the following:

1.005146    1   2   0   0   0   0
1.006025    1   2   0   0   0   0
1.008025    1   2   0   0   0   0
1.010025    1   2   0   0   0   0
1.012025    1   2   0   0   0   0
1.014025    1   2   0   0   0   0
1.015146    1   2   0   0   0   0
1.016025    1   2   0   0   0   0
1.018025    1   2   0   0   0   0
1.020025    1   2   0   0   0   0
......

when I try to plot the graph using the following command, I got only one point:

plot "queuelength.txt" using 4 with linespoints 1

and a warning to adjust both x and y range. So to fix it I use the actual x and y range

plot [0:40][0:50] "queuelength.txt" using 4 with linespoints 1

But I got nothing!! so I've tried to change the first column data for 10 rows from 1 to 10 and it works!! so does that mean gnuplot can't deal with a data that has very small difference equals to 0.002 between each row? Is there anyway to deal with it or to draw it using gnuplot?

1
Well, you don't use the first column. With plot "..." using 4 you use the row number as x-value and the fourth column with only zeros as y-value.Christoph
@Christoph so how should I fix it. I already tried using 1:4 and I got nothing as well. The y-value started with zero then it has other valuesredRose
Simply using reset; plot "queuelength.txt" using 1:4 should work fine. If not, please upload your data file somewhereChristoph
@Christoph I already tried it and didn't work. Kindly find the result file on this link drive.google.com/file/d/0Bz9dplMzAYA6blFEQWpqTmJWdVk/…redRose

1 Answers

1
votes

Your data file contains only carriage returns (ASCII 13, \r) as line endings. Gnuplot cannot handle those properly. You must have line feeds (ASCII 10, \n), or both \r\n as line endings.

What works for me is

plot '< sed ''s/\r/\n/g'' qlength_map1.txt' using 1:4