5

I've tried copying a pasting code from various examples posted on this site and in the manual, but the graph is never visible.

MWE: (this MWE comes from this posting)

\documentclass[tikz]{standalone}
\usepackage{tkz-fct}
\begin{document}
\begin{tikzpicture}[>=stealth']
\tkzInit[xmin=-15,xmax=25,
         ymin=-250,ymax=50,
         xstep=5,ystep=50]
\tkzAxeXY
\tkzFct[domain=-10:24,color=blue,very thick,<->]{14*\x-\x**2}
\end{tikzpicture}
\end{document}

Results in:

enter image description here

A.Ellett
  • 50,533

1 Answers1

6

Note that tkz-fct doesn't do the calculations itself, they are performed by Gnuplot (I think). Therefore, you need to allow for execution of external programs by compiling with the --shell-escape flag, i.e.

pdflatex -shell-escape filename.tex

There will be a warning in the log related to this, saying something like

Package pgf Warning: Plot data file `filename.tkzfct.table' not found. on input line 32.

The .table file is generated by Gnuplot, and read by tkz-fct, without -shell-escape you wont get that file.

Torbjørn T.
  • 206,688
  • T I'd like to thank you for this posted answer. – David Jan 10 '17 at 02:04
  • I just tried the latest version of MikTeX and it still doesn't work, I get the same result as the one shown in the question. I tried to add --enable-write18 as indicated in the manual, but it didn't work. I installed gnuplot on Windows 10 and the environment variable is correct. What's going on? – AndréC Oct 23 '18 at 09:26
  • @AndréC Don't know. Did you try with shell-escape? Did you look in the log file for any info? Ask a new question if you can't figure it out. – Torbjørn T. Oct 23 '18 at 09:29
  • Yes, I tried your solution, without any effect on me. I have this error: Package pgf Warning: Plot data file test-media.tkzfct.table not found. on input line 9 – AndréC Oct 23 '18 at 09:40
  • 1
    @AndréC That message indicates Gnuplot wasn't run. But as I said, ask a new question and describe in detail your setup, I don't know what's wrong. – Torbjørn T. Oct 23 '18 at 10:06
  • I asked a new question here: https://tex.stackexchange.com/q/456362/138900 – AndréC Oct 23 '18 at 10:20