4

Lately I've using the tkz-fct package for plotting graphs and I have a document with several graphs but something weird occur when I use \tkzDefPointByFct in some graphs the first graph doesn't have any problem at all

\documentclass{article}
\usepackage{tkz-fct}

\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-5,xmax=5,ymin=-3,ymax=7]
\tkzGrid[color=gray!40,line width=0.2pt]
\tkzDrawX[color=black,label={$x$},above left=5pt]
\tkzLabelX[color=black]
\tkzDrawY[color=black,label={$y$},below right=5pt]
\tkzLabelY[color=black,orig=false]
\tkzFct[domain=-2:4,color=red,line width=1.2pt]{(x-2)*(x+1)*(x-3)}
\tkzFct[domain=-1:2,color=cyan,line width=1.2pt]{(x-2)*(x+1)*(x-3)}
\tkzFct[domain=3:4,color=cyan,line width=1.2pt]{(x-2)*(x+1)*(x-3)}
\tkzSetUpPoint[size=6,color=cyan,fill=cyan]
\tkzDefPointByFct[draw](-1)
\tkzDefPointByFct[draw](2)
\tkzDefPointByFct[draw](3)
\end{tikzpicture}
\end{document}

With the next code the error FP error: UPN stack is empty!. \tkzDefPointByFct[draw](-2) pops out

\documentclass{article}
\usepackage{tkz-fct}

\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-6,xmax=4,ymin=-6,ymax=4]
\tkzGrid[color=gray!40,line width=0.2pt]
\tkzDrawX[color=black,label={$x$},above left=5pt]
\tkzLabelX[color=black]
\tkzDrawY[color=black,label={$y$},below right=5pt]
\tkzLabelY[color=black,orig=false]
\tkzFct[domain=-3:2,color=red,line width=1.2pt]{-(2*x-3)*x*(x+2)}
\tkzFct[domain=-2:0,color=cyan,line width=1.2pt]{-(2*x-3)*x*(x+2)}
\tkzFct[domain=1.5:2,color=cyan,line width=1.2pt]{-(2*x-3)*x*(x+2)}
\tkzSetUpPoint[size=6,color=cyan,fill=white]
%Error when activated all these points
%\tkzDefPointByFct[draw](-2) 
%\tkzDefPointByFct[draw](0) 
%\tkzDefPointByFct[draw](1.5)
\end{tikzpicture}
\end{document}

Any ideas of solving this problem? I would like to stick to tkz-fct

3

Looks like a parsing issue for me ... It compiles without an error after I've applied surrounding brackets () to the equations. Maybe thats required by gnuplot, but I'm not sure.

\documentclass{article}
\usepackage{tkz-fct}

\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-6,xmax=4,ymin=-6,ymax=4]
\tkzGrid[color=gray!40,line width=0.2pt]
\tkzDrawX[color=black,label={$x$},above left=5pt]
\tkzLabelX[color=black]
\tkzDrawY[color=black,label={$y$},below right=5pt]
\tkzLabelY[color=black,orig=false]
% Addiditional brackets ()
\tkzFct[domain=-3:2,color=red,line width=1.2pt]{(-(2*x-3)*x*(x+2))}
\tkzFct[domain=-2:0,color=cyan,line width=1.2pt]{(-(2*x-3)*x*(x+2))}
\tkzFct[domain=1.5:2,color=cyan,line width=1.2pt]{(-(2*x-3)*x*(x+2))}
\tkzSetUpPoint[size=6,color=cyan,fill=white]
\tkzDefPointByFct[draw](-2)
\tkzDefPointByFct[draw](0)
\tkzDefPointByFct[draw](1.5)
\end{tikzpicture}
\end{document}

enter image description here


BTW: I kinda love those tikz-packages, because they force me to use my poor French skills ;)

1
  • 1
    Well that was unexpected but effective – Very23 May 25 '16 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.