|
I'm just getting started with Gnuplot and would like to plot data from a CSV file of the form:
I can read in and plot required columns from specified number of rows, okay, e.g. using something of the form:
What I want to do is plot cols 2 and 5 ( using 1:5) for rows where the value in column 1 is specificed (so I need some way of saying "where col1val==3"). Is there a way of doing this within gnuplot? |
|
To answer my own question, http://lavica.fesb.hr/cgi-bin/info2html?(gnuplot)using suggests the following solution
So for my example, plot 'myyFile.csv' using ($1==3 ? $2:1/0):5 with lines seems to do the trick... |
|
It's a few years since I've used gnuplot in anger, but if you know a simple way to filter the data outside gnuplot (using grep, for example) then I'm fairly sure you can convince gnuplot to read data from a pipe rather than a file and achieve similar - or more complex - effects. Something like plot "|grep '^1,' < myfile.csv" ... |
Get the Data