I'm trying to plot a Bode diagram with the bodegraph package, but the curve is not shown. I don't know what to do.



\begin{tikzpicture}[gnuplot def/.append style={prefix={}},xscale=7/4]


enter image description here

  • It just red grids with no blue curve like the attached picture.
    – H.H
    Commented Dec 30, 2017 at 12:00

2 Answers 2


If I run your example, named test.tex, with

pdflatex test

I indeed get no picture, but four files called 1.gnuplot, 2.gnuplot, 3.gnuplot and 4.gnuplot are written out.

You need to run gnuplot over them and rerun pdflatex. Or, more easily, run

pdflatex -shell-escape test

so gnuplot will be called during the LaTeX run.

enter image description here

Note that you need gnuplot on your system to begin with. From the package manual:

Les commandes de tracés nécessitent que gnuplot (http://www.gnuplot.info/) soit installé et utilisable par votre distribution LaTeX.

English translation:

Plotting commands require that gnuplot (http://www.gnuplot.info/) be installed and usable by your LaTeX distribution.

  • I'm using texlive for typesetting and I run the MWE with pdflatex but it's still just two red grids.
    – H.H
    Commented Dec 30, 2017 at 12:26
  • @H.H You need to enable -shell-escape and also to have gnuplot available on your system.
    – egreg
    Commented Dec 30, 2017 at 13:18
  • I have enabled -shell-escape already. how can I see whether gnuplot is available or not?
    – H.H
    Commented Dec 30, 2017 at 13:23
  • @H.H Look in the log file, you should see what happens: look for runsystem. What's your operating system?
    – egreg
    Commented Dec 30, 2017 at 13:29
  • I have TeXLive on windows.
    – H.H
    Commented Dec 30, 2017 at 13:36

I come across the same problem with you.Finally I solve this by following this:

PGF/TikZ provides a convenient mechanism for plotting functions using GNUPLOT_. To run this example for the first time you have to do the following:

  • GNUPLOT must be installed on your system. Try typing gnuplot on the command line to see if it's installed. Windows users may have to rename wgnuplot to gnuplot.
  • You must allow TeX to run external programs. The command line option to enable this is usually --shell-escape or --enable-write18 PGF will call GNUPLOT for you and store the data in a file. Next time you compile the example, data will be loaded from the generated file. See section 11.12.3 in the manual for more information.

They come from the example file here http://www.texample.net/tikz/examples/gnuplot-basics/

If you use VS code, you can refer to this(VS Code - Latex Workshop - custom recipes file location) to enable the --shell-escape.

  • Welcome to tex.sx. Commented Jan 19, 2020 at 13:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .