Sublime Forum

Calling gnuplot from SB3 within LaTeXTools

#1

I’ve been using Sublime Text 3 with LaTeXTools on Mac for a while. Today I’d like to add some plots to a document using Gnuplot (package pgfplots). When I try to build it, I get the following error:

`[no file]:263: Package pgfplots Error: Sorry, the gnuplot-result file
'assignment4_harold.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' manually
on the respective gnuplot file.. [...ark=none, samples=100, red] function {x};]`

I have tried adding “options”:["--shell-escape"] to the "builder_settings" section of LaTeXTools.sublime-settings file it doesn’t help at all. I also tried changing it to ["-shell-escape"] but that also didn’t help.

I installed gnuplot from pkg file.

Anyone know how to do this?

0 Likes

#2

Have you installed Fix Mac Path?

0 Likes

#3

I’m not really an expert on pgfplots and gnuplot, but I was able to get this example graph working. A couple of things worth checking:

  • When you set --shell-escape in the builder_settings section, does it end up looking like this:
"builder_settings": {
    "options": ["--shell-escape"]
}

Or did you put in the osx block (which is ignored)?

  • Where is gnuplot installed on your system? On mine, I installed using homebrew and it ends up installed to /usr/local/bin/gnuplot. You can check where gnuplot is installed by running which gnuplot from the terminal.
0 Likes

#4

Just tried it. No difference.

0 Likes

#5

I downloaded and installed the pkg from the gnuplot home page. I have what you have in my settings, plus other stuff that was there already:

"builder_settings" : {

	// General settings:
	// See README or third-party documentation

	// (built-ins): true shows the log of each command in the output panel
	"display_log" : false,

	// Platform-specific settings:
	"osx" : {
		// See README or third-party documentation
	},

	"windows" : {
		// See README or third-party documentation
	},

	"linux" : {
		// See README or third-party documentation
	},
	"options": ["--shell-escape"]

},
0 Likes

#6

Can you run gnuplot from the Terminal? I.e., open Terminal.app in the normal way and type gnuplot. If not, you may want to create a symbolic link in /usr/local/bin using the following command (run from the terminal):

ln -s /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot-run.sh /usr/local/bin/gnuplot
0 Likes

#7

Yes, I just gave up and am running it from the terminal.

0 Likes