Search code examples
gnuplotscaling

How to scale an axis within multiplot


The error msg:

multiplot> plot file1 u ($1/100):2 t "" w lp
           line 0: all points y value undefined!

is listed when the script (below) is executed. What am I doing wrong?

#!/bin/bash
cat > x.dat <<- "EOF"
100 1
200 2
300 3
EOF

cat | gnuplot <<- "EOF"
file1="x.dat"
set multiplot layout 2,1
stats file1 u 1:2 name "A"
set xrange [A_min_x:A_max_x]
plot file1 u 1:2 t""  w lp
plot file1 u ($1/100):2 t "" w lp
unset multiplot
EOF


Solution

  • Your command set xrange [A_min_x:A_max_x] set the xrange to [100:300]. But the second plot command divides x by 100, so all the points would have x<100 and hence are out of range. Try set xrange [0:A_max_x] instead.