I had always accepted that, until I was plotting multiple data sets today, and all came out red (multiple data sets are made up of data that are in the same column, but in blocks separated by two empty lines; these blocks are accessible by index). I really needed more control here.
Now if I have
plot "datafile" index 0:1 using 1:2 with linespointsthat gives me two plots, both red. The simple trick is to append an index to the end of the command. This index refers to the standard order of addition mentioned above. So now
plot "datafile" index 0 using 1:2 with linespoints 1gives me a red and a blue plot. That's all! I never came across this info before.
plot "datafile" index 1 using 1:2 with linespoints 3
Oh and if you wonder why block indexing starts at 0 and column indexing at 1: there is a virtual column with index 0, which holds the line numbers. Very useful. Now why the plot index starts at 1... I don't know!
No comments:
Post a Comment