Tuesday, May 1, 2007

Gnuplot (plot part of data file)

A good reference website: http://t16web.lanl.gov/Kawano/gnuplot/datafile2-e.html

To specify a range of the data to be plotted, use the every option in the plot command. To skip every two lines, say plot "test.dat" every 2

.

When the data file contains several data blocks those are separated by a single blank line, you can skip the data block by the every option. To skip every two block, try plot "test.dat" every :2

.
every I:J:K:L:M:N
I Line increment
J Data block increment
K The first line
L The first data block
M The last line
N The last data block
every 2 plot every 2 line
every ::3 skip the first 3 lines
every ::3::5 plot from the 4-th to 6-th lines
every ::0::0 plot the first line only
every 2::::6 plot the 1,3,5,7-th lines
every :2 plot every 2 data block
every :::5::8 plot from 5-th to 8-th data blocks

Alternatively (if you are on the UNIX-like system), a part of your data file can be plotted by using the unix commands, "head" and "tail".

No comments: