The $2
is interpreted by bash and evaluates to nothing. Therefore, gnuplot plots only -0.5
. $2
is a shortcut for column(2)
. Just use the latter and it should work fine:
#!/bin/bash
gnuplot <<- EOF
set pm3d map corners2color c1
set autoscale fix
set ytics 1
splot 'Career_Choice.txt' using 1:(column(2)-0.5):3
EOF
There is no need to use bash as intermediate step, just use a gnuplot script:
file.gp
:
set pm3d map corners2color c1
set autoscale fix
set ytics 1
splot 'Career_Choice.txt' using 1:(column(2)-0.5):3
And then
call SYSTEM('gnuplot -persist file.gp')
(I'm not sure about the fortran call, just copied from the question).