TransWikia.com

Unable to diagnose missing semicolon

TeX - LaTeX Asked on November 26, 2020

I’m unable to diagnose the error message which shows up as "Missing semicolon" in the following usage of pgfplots

documentclass[border=2pt]{standalone}
usepackage{pgfplots}

begin{document}
begin{figure}
    begin{tikzpicture}
      pgfmathsetmacro{zta}{10/pi}
        pgfmathsetmacro{xb}{-pi/3}
        pgfmathsetmacro{xe}{pi/3}
        begin{axis}[xmin=-pi, xmax=pi,ymin=0,ymax=1.05,
                    xlabel={$chi$},ylabel={$f_r$},
                    declare function={f(x)=tanh(zta*(x-xb))-tanh(zta(x-xe));},
                    samples=100]
            addplot[blue, ultra thick] (x,f(x)/2);         
        end{axis}
    end{tikzpicture}
    caption{A plot of  $f_r(chi;frac{30}{pi},-frac{pi}{3},frac{pi}{3})$ over $[-pi,pi]$}
end{figure}
end{document}

I can’t point where I’m going wrong.

One Answer

    documentclass{article}
usepackage{pgfplots}
usepackage{tikz}
pgfplotsset{compat=1.16}
begin{document}
begin{figure}
begin{tikzpicture}
pgfmathsetmacro{zta}{10/pi}
pgfmathsetmacro{xb}{-pi/3}
pgfmathsetmacro{xe}{pi/3}
begin{axis}[xmin=-pi,xmax=pi,ymin=0,ymax=1.05,xlabel={$chi$},ylabel={$f_r$},declare function={f(x)=tanh(zta*(x-xb))-tanh(zta(x-xe));},samples=100]
addplot[blue, ultra thick] (x,{f(x)/2});         
end{axis}
end{tikzpicture}
caption{A plot of  $f_r(chi;frac{30}{pi},-frac{pi}{3},frac{pi}{3})$ over$[-pi,pi]$}
end{figure}

end{document}

According to your code, here's what I've got: enter image description here

That was not an answer only because I can't write all of this in a comment! and of course to show you the result that I have a doubt about it!

Answered by Med-Elf on November 26, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP