# bodegraph package just display grids but not curves

I'm using pdfLatex (with --shell-escape option) and I had a problem of compilation with TexWorks that was successfully solved with the help of other post in this site: bodegraph on Ubuntu 10.04.

After correcting that error the code compiles smoothly but just displays the logarithmic grids, not the function. The gnuplot files are created in the right place, but the graphic doesn't come out in the PDF.

Code from Martin Scharrer’s asnwer:

\documentclass{article}

\usepackage{tikz}
\usepackage{bodegraph}

\begin{document}

\begin{tikzpicture}[
gnuplot def/.append style={prefix={}}, % Fixed the issue (prefix was 'gnuplot/\jobname/' before)
]
\begin{scope}
\UnitedB
\semilog{-1}{2}{-50}{60}

\BodeAmp{-1:1.35}{\POAmpAsymp{4}{2.0}+\IntAmp{1}}

\end{scope}
\end{tikzpicture}
\end{document}


Any clues?

• Please include the code example. Is it the same as from Martin Scharrer’s answer? Mar 12 '13 at 21:19
• That's right, it is. Mar 12 '13 at 21:27
• Meanwhile I checked the gnu plot directory and I found just 5 files with the extension ".gnuplot", but no tables. Is this correct? Mar 12 '13 at 21:28
• I can see the curve, but only scaling down the picture several times. Mar 12 '13 at 23:05

Example compiles on my distribution (miktex2.9, gnuplot and windows 7 and texworks as editor). I compile with pdflatex - enable-write18

But, you have to choose xscale and yscale (default unit is cm)

for x you have to draw 3 decades, if the desired width is 10cm then xscale=10/3 the same thing for yscale, here you can choose yscale=10/110 (110dB)

\documentclass{article}

\usepackage{tikz}
\usepackage{bodegraph}

\begin{document}

\begin{tikzpicture}[
gnuplot def/.append style={prefix={}}, % Fixed the issue (prefix was 'gnuplot/\jobname/' before)
]
\begin{scope}[xscale=10/3,yscale=10/110]
\UnitedB
\semilog{-1}{2}{-50}{60}

\BodeAmp{-1:1.35}{\POAmpAsymp{4}{2.0}+\IntAmp{1}}

\end{scope}
\end{tikzpicture}
\end{document}


thancks

• Hello rpapa.Thank you for your answer. I run your example with pdfLaTex -enable-write18 and still get no graphics. Only the grid. My system is MacOSX mountain Lion - TexLive 2012 - TeXworks. So the problem must be in some configuration of my system, wouldn't you say? Any particular settings in the TeXworks? Mar 13 '13 at 18:57
• In TeXworks where do you put the option -enable-write18? I used Preferences-Typesetting-Processing tools. The I chose pdfLatex and clicked Edit button. Then I added in front of the "Name" pdflatex -enable-write18. I also tried to add the option as an argument. Mar 13 '13 at 19:19
• I can't answer for mac system, sorry Mar 13 '13 at 21:47
• Here is the screenshot of my configuration texworks tinypic.com/r/2rcrgwy/6 Mar 13 '13 at 21:50
• jablp - did you find a resolution? I am experiencing the same problem
– 1yen
Aug 2 '16 at 9:19

For me the answer was to use -shell-escape or -enable-write18. If I understood correctly, this allows PdfLaTeX to run commands on the terminal (in this case to run gnuplot). Since commands could be harmful, this option is disabled by default.

To activate it, make sure to pass the option before %.tex (pretty obvious but took me a while)!

Finally, my TexStudio configuration on ArchLinux with gnuplot installed looks like this:

• Indeed, on macs (see this comment—assuming a MacTeX/TeXLive distribution) the relevant option is named -shell-escape, not -enable-write18.
– GuM
Mar 24 '17 at 1:23

Your figure seems to be a bit unfortunate, so I give an answer to this answer. I could make it work on MacOS by

1. First create a folder gnuplot,

mkdir gnuplot

2. Then create a subdirectory with the same name as the filename except for the .tex extension. So if the file has the name test.tex, I'd say

mkdir gnuplot/test

3. Then compile the file with

pdflatex -enable-write18 test.tex