Your code works:
You need to read your .log
file to verify two things:
the path for gnuplot
. If the path is fine then you must find a line like gnuplot
executed or something like that
if in your .log
file, you have something like
file.table not found,
then you need to use the option --shell-escape
or write18
in your script for the compilation.
The problem is the same with pgfplots
or another package that uses gnuplot
.
Most of the the answer to this is contained in the following question:
However, depending on how your system is set up you may need to do some extra things.
First, compiling source code on a Mac requires you to install XCode from the App store (it's free). See the following link for a nice description:
Second, you also need to allow TeX to run external programs like GnuPlot. Typically the way to do this is to run programs with the --shell escape
option. However, recent version of TeX Live have created a system of so-called "restricted" shell escape, which allows you to add programs to a global list of external programs to minimize the security issues of using unrestricted shell escape.
There are a number of different ways to implement this on a Mac.
Create a TeXShop engine file for --shell-escape
The simplest way is probably to create a new TeXShop engine file which runs the appropriate LaTeX command with the --shell-escape
option enabled. See:
Create a config file in your texmf-local
folder
If you are using gnuplot
capabilities a lot, it might be easiest to add gnuplot
to your list of allowable programs. This can be done by creating a local texmf.cnf
file. Create the following file:
shell_escape_commands = bibtex,bibtex8, kpsewhich, makeindex, mpost, repstopdf, gnuplot,
The file must end with a blank line. Save or copy this file into the following directory:
(you will need administrator access to do this.)
/usr/local/texlive/texmf-local/web2c
Then run texhash
to update the TeX database.
Now you should be able to use gnuplot
from within your TeX documents.
Best Answer
Check that at least TikZ/PGF 2.10 is installed on your system. This is required for tkz-fct. If necessary, update TikZ/PGF using the MiKTeX package manager.