|
From: Yub Y. <yu...@ro...> - 2012-09-28 14:02:38
|
Hi all, I'm new to gnuplot. I'm using gnuplot 4.6.0 on Ubuntu 12.04. I've done a bunch of reading of tutorials and documentation, though there are some things I'm having trouble figuring out how to do (or even if it's possible to do). In particular at the moment, I have the following issue -- which has been hard to search for solutions to, since the associated keywords are common to other questions and issues. I have a file with columns of data which I would like to plot -- which is simple enough. However, one of the columns is an index, which denotes which data-set the line belongs to. (The lines are all in one long mixed group -- there are no sections or extra newlines.) I would like to create a separate graph for each index in the file. I found in the documentation[1] how to use the ternary operator to omit values based on column values, but this approach has several problems. First, the documentation recommends setting points to undefined (1/0), which means that if I'm plotting "with linespoints", then any time there are consecutive lines in the file which have different indices, there is a break in the graph. Second, it seems that I would need to know all of the indices in the file before running gnuplot on it, so that I could tell it to plot each of the different indices. (Using a loop perhaps, but I'd still need to know them all beforehand.) One solution is to simply write a simple (eg. Python) script to parse the data file beforehand to sort/reformat it, break it into multiple files or sections, or something like that. Then it could create gnuplot code to hand it off to. However, I would like to know if I can accomplish this using only gnuplot, for an arbitrary file. Thank you so much! -Yub [1] Bottom of page 84: http://www.gnuplot.info/docs_4.6/gnuplot.pdf |