Antes de tudo, você precisa ter certeza de que gnuplot está falhando. Para isso basta executar o seu comando e depois perguntar ao shell o código de saída com echo $?
gnuplot -e "plot 'data.dat'"
echo $?
-
Se retornar
0, significa que a execução foi concluída sem erro. O parâmetro-persistpode corrigir seu problema.gnuplot -persist -e "plot 'data.dat'" -
Se ele retornar um número diferente de
0, significa que ele caiu.
A partir deste wikibook você pode ler algumas dicas:For debugging a
gnuplotfile, it is often useful to:- Change the terminal to interactive (instead of outputting to a file), by commenting out set terminal and output lines.
- Start
gnuplotinteractively, then load the file in question. - Put pause -1 (pause until carriage return) at the end of the file, then run it from the command line.
- Alternatively, run
gnuplotwith the-persistcommand line switch, sognuplotexits, but the window persists. -
Make the file itself executable, by shebang (#!) notation (depends on exact path):
#!/usr/bin/gnuplot -persist
Posso acrescentar que você pode chamar
gnuplotcom traço como o último parâmetro para permanecer no regime interativo quando o script for concluído.gnuplot filename.gp - 'Então você pode começar a dividir seu script até encontrar o erro (ou você pode escrever em algumas linhas de pontos como
print "here I am #1"...print "here I am #n", executá-lo e ler o último Here I Am # ).
Existe um debug terminal de gnuplot que, se habilitado em sua versão, pode ajudar no procedimento de depuração. A partir daqui é possível ler sobre isso
This terminal is provided to allow for the debugging of gnuplot. It is likely to be of use only for users who are modifying the source code