0

As the image shows I am drawing two curves y=x^3-8 and its inverse y=(x+8)^(1/3) using \tkzFct. As you can see the first graph plots fine suggesting that GnuPlot is working ok and set up properly in my system.

When I increase the domain for the second function the whole graph does not plot. The red bit is missing!

Unfortunately the manual is in French so I am struggling to access!

The image i am hoping to achieve

My MWE

\usepackage[left=8mm, top=12mm, right=10mm, bottom=12mm]{geometry}

\usepackage{pgfplots} \usepackage{tkz-base} \usepackage{tkz-fct}

\begin{document} \begin{center} \begin{tikzpicture}[scale=0.6] \tkzInit[xmin=-20,xmax=4,ymin=-9,ymax=4] \tkzDrawX[line width=0.9mm] \tkzDrawY[line width=0.9mm] %\tkzGrid[color=gray!70,line width=0.05mm] % \tkzLabelY[orig] \tkzLabelX[swap] \tkzFct[domain=-4:6,line width=0.5mm,samples=400]{x3-8} \tkzFct[domain=-12:4,line width=0.5mm,samples=400]{(x+8)(0.33333)} \end{tikzpicture} \end{center} \end{document} ```

ToyBoy
  • 117

1 Answers1

0

It appears that Gnu Plot does not like cube rooting negative numbers. By using the sign of the x term and the absolute cube root of x and then combining along with thought out domains it works.

This is the code I added!!

\tkzFct[domain=-10:-8,line width=0.5mm,samples=400]{sgn(x)*abs(x+8)**(1/3.0)} \tkzFct[domain=-8:4,line width=0.5mm,samples=400]{abs(x+8)**(1/3.0)}

ToyBoy
  • 117