rlkamalapurkar / bodeplot

LaTeX package to plot Bode diagrams
LaTeX Project Public License v1.3c
6 stars 1 forks source link

Interferance with plot #3

Closed AndreaDiPietro92 closed 2 years ago

AndreaDiPietro92 commented 2 years ago

Hi :wave:! Trying to plot a function with TiKZ (with bode plot loaded) i gets several errors in compilation. Removing the package all the errors disappears.

Code for testing

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgf,tikz}
\usepackage{pgfplots}
\usepackage{siunitx}
\pgfplotsset{compat=newest}

%\usepackage{bodeplot}

\begin{document}

        \begin{tikzpicture}
        % sin
        \draw[line width=2pt, blue]
        plot[domain=0:2*pi, samples=100] (\x/3,{sin(\x r)});

    \end{tikzpicture}

\end{document}

With the %\usepackage{bodeplot} all works otherwise i get image

rlkamalapurkar commented 2 years ago

This error is a result of me setting the /pgfplots/variable key to t in the package. Not sure about the best way to address this yet. In the meantime, just add variable=\x to your plot command.

\documentclass{standalone}
\usepackage{bodeplot}
\pgfplotsset{compat=newest}
\begin{document}
    \begin{tikzpicture}
        \draw[line width=2pt, blue] 
        plot [domain=0:2*pi, samples=100, variable=\x] (\x/3,{sin(\x r)});
    \end{tikzpicture}
\end{document}

EDIT: According to this StackExchange question, the /tikz/variable key is also set when I set the /pgfplots/variable key. When I get some time, I will update the package to set the /pgfplots/variable key locally, so that it doesn't interfere with other packages.