Gnuplot plot specific lines from data file -


i have data file 24 lines , 3 columns. how can plot data specific lines, e.g. 3,7,9,14,18,21? use following command

plot 'xy.dat' using 0:2:3:xticlabels(1) boxerrorbars ls 2 

which plots 24 lines.

i tried every command couldn't figure out way works.

untested, this

plot "<(sed -n -e 3p -e 7p -e 9p xy.dat)" using ... 

another option may annotate datafile, if seems, contains multiple datasets. let's created datafile this:

1 2 3 2 1 3 # seta 2 7 3 # setb 2 2 1 # seta setb setc 

then if wanted seta use sed command in plot statement

sed -ne '/seta/s/#.*//p' xy.dat 2 1 3 2 2 1 

that says..."in general, don't print (-n), but, if see line containing seta, delete hash sign , after , print line".

or if wanted setb, use

sed -ne '/setb/s/#.*//p' xy.dat 2 7 3 2 2 1 

or if wanted whole data file, stripped of our comments

sed -e 's/#.*//' xy.dat 

if wanted setb , setc, use

sed -ne '/set[bc]/s/#.*//p' xy.dat 2 7 3  2 2 1 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -