Here I present an easy example how to use indexed datafiles.
The main idea is that you want to split the rows in a datafile into chunks and plot only one or more chunks of these. The - probably not so easy to fulfill - requirement is that data chunks are separated by two empty lines. The chunks are indexed (starting at 0, thus the name indexed datafile) and can be used in a plot statement as described further down.
Consider this example (call it indexed.dat):
20 3 17 34 40 25 14 10 15
The gnuplot code and its generated graphs
set term png medium size 200,200 set yrange [0:*] unset key # generate a graph from the first chunk of data set output 'indexed1.png' set title 'first data set' plot 'indexed.dat' index 0 using 1 with lines # generate a graph from the second chunk of data set output 'indexed2.png' set title 'second data set' plot 'indexed.dat' index 1 using 1 with lines # generate a combined graph from the second # and third chunk of data set output 'indexed3.png' set title "second and third\n data set" plot 'indexed.dat' index 1:2 using 1 with lines |
No comments:
Post a Comment