by tcoake on Mon Mar 04, 2013 6:33 pm
Ok, found the solution! For one reason or other I didn't think of this before but you have to enable -shell-escape or write-18, which is the same thing you have to do on any other editor. There is not an option to enable this within ST2, instead you must edit the file: LaTeX.sublime-build. The file is easiest to locate from within ST2 by going to Preferences -> Browse Packages-> LatexTools -> Latex.sublime-build and edit and save the file as follows:
"cmd": ["latexmk", "-cd",
"-e", "\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 -shell-escape %S'",
//"-silent",
"-f", "-pdf"],
This has worked for me and I installed gnuplot via macports and used a symbolic link to usr/local/bin. I'm not sure if the link is necessary since I had done this earlier to get TeXshop to find gnuplot.