Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How I can draw curves as :

enter image description here

Any help would be appreciated.

share|improve this question
3  
What have you tried? What package are you using? pgfplots? tikz? –  Jubobs May 19 at 18:21
    
@Jubobs, I have no idea how to draw curves with latex. –  Med May 19 at 18:27
    

3 Answers 3

up vote 11 down vote accepted

I'd suggest you 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}

enter image description here

share|improve this answer
    
Thank you so much sir for your help. –  Med May 19 at 19:19

Run with xelatex. \psplotImp plots the implicit defined functions:

\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}

enter image description here

share|improve this answer
    
Thank you so much Herbert. –  Med May 19 at 19:45

Just for fun.

\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}

enter image description here

The higher resolution can be seen here (click).

share|improve this answer
    
Thanks for your help :) –  Med May 19 at 19:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.