0

I am just a beginner and am writing my first report in LaTeX, so excuse me if the solution is very obvious. I am trying to plot asymptotic approximation of bode plots using the package bodeplot as answered here, I simply copied and pasted the following sample code as give in the documentation,

\begin{BodeMagPlot}[% axes/{height=2cm, width=4cm} ] {0.01} {100} \addBodeZPKPlots[% asymptotic/{blue,dotted,thick}% ] {magnitude} {% z/{0,{-0.1,-0.5},{-0.1,0.5}}, p/{{-0.5,-10},{-0.5,10}}, k/10% } \end{BodeMagPlot} 

Now if I am using Overleaf to compile, I am getting the expected results, but then when I use the exact syntax in MikTeX installed on my PC, I do not get any plot, and instead, two warnings messages are displayed:

\ifplatform.sty:0:shell escape is disabled, so I can only detect \ifwindows

You have an axis with empty range (in direction y). Replacing it with a default range and clearing all plots

As far as I can tell the second warning is why I didn't get any plot, but I couldn't understand how to rectify this by giving the range for y-axis, and why does this run in Overleaf, but not on my system? And if the first warning is responsible for this somehow.

1
  • Welcome! Overleaf compiles your document in a sandbox and enables unrestricted shell-escape because the sandbox makes that safe. TeX distributions don't enable unrestricted shell-escape by default because it is a security vulnerability. So you need to compile this document with shell-escape. For TeX Live, it would be -shell-escape or --shell-escape. MikTeX has a similar option, but I think it might be differently named. (If you are using LuaTeX, it gets a tiny bit more complicated, but this is sufficient for other engines.) Commented Jul 12, 2024 at 0:56

2 Answers 2

0

Like the comment says, you need to invoke LaTeX with the --shell-escape flag.

pdflatex --shell-escape file.tex 

The other option is to use native pgf instead of gnuplot to do the computations. External commands (i.e., --shell-escape) are needed only for gnuplot. If you do not use gnuplot, then you do not need --shell-escape.

To do this, use the bodeplot package withe the pgf option:

\usepackage[pgf]{bodeplot} 

The use of lualatex is recommended if you use native pgf to do calculations.

0

What I was missing here was that the package uses GNUplot rather than pgf, installing GNUplot resolved the issue.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.