I want to have a single .plt file storing both data and gnuplot commands. My data looks like
# x1 y1 x2 y2
1 2 3 4
5 6 7 8
and co
I'm not sure how much you can edit the file, but the tidiest way is probably to put the whole thing in a shell script/batch script (are you on linux or windows?)
On linux I do something like this
#!/bin/bash
#put my data in a file
echo "
# x1 y1 x2 y2
1 2 3 4
5 6 7 8
" > my_dat.dat
#launch gnuplot
gnuplot<
Then I chmod +wrx the file I put the above commands in and run.
Note: there also seems to be a similarity to this question:
gnuplot stdin, how to plot two lines?
So you might want to look there too