我需要绘制一条隐式曲线。我使用tikzpicture
和pgf plots
来绘制方程$y^4=y^2-x^2$
。当我使用绘制上面的隐式曲线时GeoGebra
,它显示了此信息 PGF/Tikz and Gnuplot don't support implicit curves
有人能帮助我吗?
多谢!
答案1
第一选择:PSTricks
\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}
第二种选择:SageTeX
\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}
第三大选择:Mathematica
ContourPlot[y^4-y^2+x^2==0,{x,-1,1},{y,-1,1}]
答案2
\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}