How can be plotted a transfer function in a bodeplot. I just installed the bodegraph package, and have the "paper" already done but I dont understand the format to input the transfer function, I dont know what is missing.





    gnuplot def/.append style={prefix={}}, % Fixed the issue (prefix was 'gnuplot/\jobname/' before)
semilog lines/.style={thin, blue},
semilog lines 2/.style={semilog lines,
red!50 },
semilog half lines/.style={semilog lines 2,
dotted },
semilog label x/.style={semilog lines,
semilog label y/.style={semilog lines,


enter image description here

Looking the output it says

Package pgf Warning: Plot data file `1.table' not found. on input line 15.

I don't want to edit the .sty file to update, so how can be adjusted the code? I understand the bodeplot package uses gnuplot, so it has been checked and confirmed to be installed on the system.

New Update
I have reinstalled the bodegraph package, but Im still mismatching the function.The idea is to make it to look more or less to

enter image description here I dont know what function is it.

  • 3
    The latest version of bodegraph is 11 years old. I do not know Bode plots, but it looks straight forward - can PGFPlots not be used? Sep 16, 2021 at 7:48
  • 3
    Basically, a Bode plot is a log-log plot with dB (10 log(y)) verses frequency. The tricky bit is that it takes y as as input but shows dB on the y axis, not y. Sep 16, 2021 at 15:27

2 Answers 2


I do not know what a Bode plot is, but her is a replica of your graph in PGFPlots.

\documentclass[tikz, border=1 cm]{standalone}
   xmin=1, xmax=10000000,
   ymin=0, ymax=110,
   axis x line=bottom,axis y line=left,
   every axis x label/.style={
     at={(ticklabel* cs:1.05)},
   every axis y label/.style={
     at={(ticklabel* cs:1.05)},
   tick align=outside,
   extra y ticks={106}, extra y tick labels={106},
   extra y tick style={y tick  style={draw=none}},
   axis on top=true,
  \fill[lightgray] (1,0) rectangle (10,106);
  \draw[dashed] (10,0) -- (10,106);
  \addplot[blue, thick] coordinates {(1,106) (10,106) (2000000,0)};

Semilog plot with single blue line and filled gray area


I digged out a Bode plot I used in one of my exercises. This is plotted manually, and already in dB in the y axis, with the real (red) and asymptotic (draw by hand, in this case, but there are other strategies). It has big fonts because it's normally in an inset on the page, but you can change them easily.

I hope it can help as a starting point.

\begin{tikzpicture}[baseline=(g.north),]% name and baseline are for positioning the graph
                height=5cm, width=0.5\linewidth,
                xmin=1, xmax=1000,xmode=log,
                ymin=0, ymax=60,
                xlabel = {$f$~(Hz)},
                ylabel = {$|A_v|$~(dB)},
                legend style = {nodes={right, font=\scriptsize}, at={(0.05,0.6)}, anchor=west},
                clip mode = individual,
                \addplot[thick, blue, domain=1:4] {14};
                \addplot[thick, blue, domain=318:1000] {52};
                \draw [thick, blue] (4,14) node[right=8pt]{\SI{14}{dB}} -- (318,52) node[left=8pt]{\SI{52}{dB}};
                \draw [thick, blue, dashed] (318,52) -- (318,0) node[above left]{\SI{318}{Hz}};
                \draw [thick, blue, dashed] (4,14) -- (4,0) node[above left]{\SI{4}{Hz}};
                % notice that 20*log10(sqrt...) is the same as 10*log(...)
                \addplot[red] {14 % static gain
                        +10*log10(1+x*x/(4*4)) % zero
                        -10*log10(1+x*x/(318*318)) % pole

enter image description here

  • 1
    Its a great example and not so simple, ita very valuable, and taking into account its made at hand. Thanks so much.
    – avelardo
    Oct 3, 2021 at 16:07

You must log in to answer this question.

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