3

I need to plot a implicit curve. I use tikzpicture and pgf plots to draw the equation $y^4=y^2-x^2$. when I use as GeoGebra for drawing implicit curves above, It show this massage PGF/Tikz and Gnuplot don't support implicit curves

Anyone can help me?

Thanks a lot!

2
  • 4
    Welcome! gnuplot does allow you to plot implicit curves. However, here you only need \documentclass[tikz,border=3mm]{standalone} \begin{document} \begin{tikzpicture}[declare function={myx(\y)=sqrt(pow(\y,2)-pow(\y,4));}] \draw plot[variable=\y,domain=-1:1] ({myx(\y)},\y); \end{tikzpicture} \end{document}.
    – user194703
    May 11, 2020 at 21:47
  • Peraphs this can help you? tex.stackexchange.com/questions/442758/how-to-draw-y4-y2-x/…
    – Sebastiano
    May 12, 2020 at 7:44

2 Answers 2

3

First Resort: PSTricks

enter image description here

\documentclass[pstricks,12pt]{standalone}
\usepackage{pst-func}
\psset{unit=2cm}
\begin{document}
\begin{pspicture}(-1.5,-1.5)(1.75,1.75)
    \psaxes{->}(0,0)(-1.25,-1.25)(1.25,1.25)[$x$,0][$y$,90]
    \psplotImp[algebraic,linecolor=red,stepFactor=0.1](-1.1,-1.1)(1.1,1.1){y^4-y^2+x^2}
\end{pspicture}
\end{document}

Second Resort: SageTeX

enter image description here

\documentclass{standalone}
\usepackage{sagetex}

\begin{document}
\begin{sagesilent}
f(x,y) = y^4-y^2+x^2
\end{sagesilent}
\sageplot{implicit_plot(f(x,y)==0,(-1,1),(-1,1))}
\end{document}

Third Resort: Mathematica

enter image description here

ContourPlot[y^4-y^2+x^2==0,{x,-1,1},{y,-1,1}]
2
  • 1
    The last resort: the other existing answers! May 12, 2020 at 15:07
  • 1
    Your answer (First Resort: PSTricks) was exactly what I wanted. Thanks a lot
    – kawsar
    May 12, 2020 at 19:38
3
\documentclass[pstricks]{standalone}
\usepackage{pst-contourplot}
\begin{document}
\begin{pspicture}(-5,-6)(5,6)
\psset{linecolor=orange,unit=5}
\psset{Fill,a=0.01,linewidth=2pt,function=y^4-y^2+x^2,algebraic}
\psContourPlot[fillcolor=cyan,algebraic](-1,-1)(0,0)
\psContourPlot[fillcolor=blue](-1,0)(0,1)
\psContourPlot[fillcolor=cyan](0,0)(1,1)
\psContourPlot[fillcolor=blue](0,-1)(1,0)
\end{pspicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .