使用 Latex 绘制曲线

使用 Latex 绘制曲线

如何绘制曲线:

在此处输入图片描述

任何帮助,将不胜感激。

答案1

我建议你pgfplots

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}

\pgfplotsset{
  compat=1.10,
  axis lines=middle,
  width=6cm,
  height=7cm,
  samples=90,
  xtick=\empty,
  ytick=\empty,
}

\newcommand\Title[2]{%
$
\begin{array}{r@{\,=\,}l}
y^{2} &#1 \\ 
\Delta & #2
\end{array}
$
}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
  title={\Title{x^{3}-3x+3}{2160}}
]
\addplot[domain=-2.1:4] {sqrt((x^3)-3*x+3)};
\addplot[domain=-2.1:4] {-sqrt((x^3)-3*x+3)};
\end{axis}
\end{tikzpicture}\qquad
\begin{tikzpicture}
\begin{axis}[
  xmin=-0.5,
  title={\Title{x^{3}+x}{-64}}
]
\addplot[domain=0:3] {sqrt(x^3+x)};
\addplot[domain=0:3] {-sqrt(x^3+x)};
\end{axis}
\end{tikzpicture}\qquad
\begin{tikzpicture}
\begin{axis}[
  xmin=-1.5,
  title={\Title{x^{3}-x}{64}}
]
\addplot[domain=-1:0] {sqrt(x^3-x)};
\addplot[domain=1:2] {sqrt(x^3-x)};
\addplot[domain=-1:0] {-sqrt(x^3-x)};
\addplot[domain=1:2] {-sqrt(x^3-x)};
\end{axis}
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

运行xelatex.\psplotImp绘制隐式定义的函数:

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-func}
\begin{document}

\begin{pspicture*}[showgrid,stepFactor=0.2,algebraic](-3,-3)(4,3)
\psaxes[labelFontSize=\scriptstyle,ticks=none,labels=none]{->}(0,0)(-3,-3)(4,3)
\psplotImp[linewidth=1pt,linecolor=blue] (-4,-4)(5,4){ y^2-x^3+3*x-3  }
\psplotImp[linewidth=1pt,linecolor=red]  (-4,-4)(5,4){ y^2-x^3-x  }
\psplotImp[linewidth=1pt,linecolor=green](-4,-4)(5,4){ y^2-x^3+x  }
\rput[lb](-3,2.5)   {\blue$y^2=x^3-3*x+3$}
\rput[rb](1.2,-2.75){\red$y^2=x^3+x$}
\rput[lb](1.5,-0.5) {\green$y^2=x^3-x$}
\end{pspicture*}

\end{document}

在此处输入图片描述

答案3

只是为了好玩。

\documentclass[border=12pt]{standalone}
\usepackage{pst-func}
\begin{document}
\foreach \f/\c/\l in 
{
    x^3-3*x+3/red/x^3-3x+3,
    x^3+x/green/x^3+x,
    x^3-x/blue/x^3-x%
}{
\begin{pspicture*}[algebraic,stepFactor=.2](-3.5,-4.5)(4.5,4.5)
  \psaxes{->}(0,0)(-3,-4)(4,4)[$x$,0][$y$,90]
    \psplotImp[linecolor=\c](-4,-3.5)(4,3.5){-y^2+\f}
    \rput(2,-4){\textcolor{\c}{\large$y^2=\l$}}
\end{pspicture*}\qquad}

\end{document}

在此处输入图片描述

可以看到更高的分辨率此处(点击)

相关内容