You must use column(i)
to select the i-th column. $1
is a shortcut for column(1)
but you cannot use $i
as shortcut for column(i)
:
set style data lines
i=2
plot '-' using (column(i)):xticlabels(1) title columnheader(i)
A B
1 10
2 20
3 ?
4 40
5 50
e