I have the following script called tmp.plt
for gnuplot:
plot \
"n300_50int/ini-ene.his" using 1:2, \
"n500_100int/ini-ene.his" using 1:2, \
"n500_1ooint_0.65e3/ini-ene.his" using 1:2, \
"n500_50int/ini-ene.his" using 1:2
But it gives me the error
samuel@samuel-P5Wx6:~/Documents/Fisica/19-20/Radiactividad/Prácticas/Practicas-MontCarlo/PET/Simulaciones$ gnuplot -p tmp.plt plot "n300_50int/ini-ene.his" using 1:2, \ ^ "tmp.plt", line 2: invalid character \
I've created this script with the following .sh (edited from the one in Gnuplot: Plot several in files in different folders ) :
#!/bin/bash
## truncate tmp.plt and set line style
echo -e "plot \\" > tmp.plt
cnt=0 ## flag for adding ', \' line ending
## loop over each file
for i in */ini-ene.his; do
if ((cnt == 0)); then
cnt=1
else
printf ", \\ \n" >> tmp.plt
fi
printf "\"$i\" using 1:2" >> tmp.plt
done
echo "" >> tmp.plt
And I don't understand why it doesn't work when the next test.plt
file does
f(x)=x
g(x)=2*x
plot \
f(x) , \
g(x)
Thank you!