Command line variables
Let us use undefined variables
COLUMN in the gnuplot script
plot FILE using 1:COLUMN with lines
They can be defined at execution:
gnuplot -e "FILE='data.txt'; COLUMN=2" plot.gp
Support CSV files:
set datafile separator ","
Use the first CSV row as title:
set key autotitle columnhead noenhanced
noenhanced is to disable (LaTeX-like) subcripting with underscore.
set ylabel "First Y axis" set y2tics # Enable second axis set ytics nomirror # Don't copy tics on second axis set y2label "Second Y axis" plot "filename" using 1:2 with lines, "" using 1:3 with lines axis x1y2