Please consider this MWE:


\pgfplotsset{soldot/.style={color=black,only marks,mark=*}}
\pgfplotsset{holdot/.style={color=red,fill=white,very thick,only marks,mark=*}}


            legend pos=outer north east,
            axis lines = center,
            label style={font=\tiny},
            legend style={font=\tiny},
            xticklabel style = {font=\tiny},
            yticklabel style = {font=\tiny},
            xlabel = $x$,
            ylabel = $y$,
            legend style={cells={align=left}}
        \addplot[red,thick] {x*x*x-y*y-y};


Original graph

Overleaf throws me the following error:

! Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots expected to sample a line, not a mesh. Please use the [mesh] option combined with [samples y>0] and [domain y!=0:0] to indicate a twodimensional input domain.

so I change

\addplot[red,thick] {x*x*x-y*y-y};


\addplot[samples y>0, domain y!=0:0,red,thick] {x*x*x-y*y-y};

but now 4 errors appears, and when using addlegendentry the picture is Mesh picture instead of the normal line.

I would like to graph the implicit function like this:

What I want

not using gnuplot. Is that possible?



You wish to plot x^3-y^2-y=0, which is equivalent to x^3=y^2+y or x=sign(y^2+y)\cdot|y^2+y|^{1/3}.

\begin{axis}[axis lines=middle,xlabel=$x$,ylabel=$y$,title=lul]

enter image description here

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.