I'm using GNUPLOT with a PC. Is there a way to only plot some selected rows from a data file instead of every rows?
for example I have the following data file:
80000.00 1000.000 234.4000
10000.00 2000.000 237.2000
20000.00 3000.000 240.0000
30000.00 4000.000 242.8000
40000.00 5000.000 245.3000
10000.00 1000.000 247.4000
20000.00 2000.000 249.7000
30000.00 3000.000 252.8000
10000.00 1000.000 257.7000
20000.00 2000.00 263.4000
30000.00 3000.00 269.6000
10000.00 1000.00 275.8000
20000.00 2000.00 280.3000
30000.00 3000.00 286.7000
What if I only want to plot all the second column with value "1000"? Any tricks to do this? Thank you very much in advance.
Asked
Active
Viewed 701 times
0

Tallent Siu
- 123
- 1
- 6
-
See http://stackoverflow.com/a/30522520/2604213 – Christoph Jul 20 '15 at 18:30
2 Answers
0
GNUPLOT has an "every" option which you need to use.
plot "data.txt" every ::10::100
will plot all data from line 10 to line 100. Leaving any of the two line nos. blank will result in GNUPLOT plotting from the first line / till the last line.
An alternative, time intensive method is to comment out the lines you don't want plotted. But the above method is of course much better.

Aritra
- 400
- 3
- 10
-
Thanks for your reply, but what I'm looking for is to only plot those record which the 2nd column value ="1000". So basically I will only plot the 1st column as y-axis and the 3rd column as x-axis with 2nd col value is equal to 1000. Any method to do this? Thank you again. – Tallent Siu Jul 20 '15 at 06:33