You are only allowed to specify a range at the beginning of the plot
command. This range applies to all of the following, comma-delimited parts of this plot
command. So you could use
plot [xmin:xmax] f(x),\
"datafile1" u 1:2:6:7:10:11 with xyerrorbars
But that would apply the [xmin:xmax]
range also to the datafile1
. If you only want to limit the range of f(x)
, you must define a function which is invalid (1/0
) outside of the desired range:
plot "datafile1" u 1:2:6:7:10:11 with xyerrorbars,\
"datafile1" u 1:4:8:9:10:11 with xyerrorbars,\
"datafile2" u 1:2:3 with xyerrorbars,\
(x > xmin && x < xmax) ? f(x) : 1/0
Note, that your original command will work in the upcoming gnuplot version 5.0