调试一个文件,用pgfplot调用gnuplot作非线性拟合并绘出拟合曲线;
可以参考这里点击打开链接
结果小的测试文件轻松通过了, 同样的代码和同样的"前言"preamble,正常文章编译总是出错:
! Package pgfplots Error: Sorry, the gnuplot-result file 'file name with blanks.pgf-plot.table' could not be found. Maybe you need to enable the shell-escape feature? For pdflatex, this is
'>> pdflatex -shell-escape'. You can also invoke '>> gnuplot <file>.gnuplot' ma
nually on the respective gnuplot file..
如果网上去搜, 发现出错原因通常是gnuplot没有正确配置,但是小文件可以编译,说明不是这个原因.
苦思冥想不得要领.
今天早上采用逐段调试方法,一下子醒悟,gnuplot应该不支持文件名带有空格!
把论文源文件的文件名另存为不带空格的,从头编译,结果顺利通过.
调试一个bug,找到一个解决方法,就是对自己低级错误的一种纠正.