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.

Only top portion of half my hyperbola is coming in correctly. The other half is doing something strange:

enter image description here

\documentclass{article}
\usepackage{tikz, pgf}
\begin{document}
\begin{center}
  \begin{tikzpicture}
    \begin{scope}
      \clip (0,-3) rectangle (4,3);
      \draw [samples = 50, domain = -0.99:0.99,
      rotate around = {0:(0,0)}, xshift = 0cm, yshift = 0cm]
      plot ({0.69*(1+\x^2)/(1-\x^2)}, {0.72*2*\x/(1-\x^2)});
    \end{scope}
  \end{tikzpicture}
\end{center}
\end{document}
share|improve this question
    
You tagged this as pgfplots but not using it. Compare the difference \begin{tikzpicture}\begin{axis}\addplot [samples = 50, domain = -0.99:0.99] ({0.69*(1+\x^2)/(1-\x^2)}, {0.72*2*\x/(1-\x^2)});\end{axis}\end{tikzpicture} –  percusse Apr 15 '13 at 23:50

2 Answers 2

up vote 8 down vote accepted

Substituting \x*\x or (\x)^2 for \x^2 fixes your problem.

enter image description here

\documentclass{article}
\usepackage{tikz, pgf}
\begin{document}
\begin{center}
  \begin{tikzpicture}
    \begin{scope}
      \clip (0,-3) rectangle (4,3);
      \draw [samples = 50, domain = -0.99:0.99,
      rotate around = {0:(0,0)}, xshift = 0cm, yshift = 0cm]
      plot ({0.69*(1+\x*\x)/(1-\x*\x)}, {0.72*2*\x/(1-\x*\x)});
    \end{scope}
  \end{tikzpicture}
\end{center}
\end{document}
share|improve this answer

With PSTricks.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-math}
\def\X(#1){COSH(#1)}
\def\Y(#1){SINH(#1)}
\psset{algebraic}
\begin{document}
\begin{pspicture}(-6,-4)(6,4)
    \psaxes{->}(0,0)(-6,-4)(5.5,3.5)[$x$,0][$y$,90]
    \psset{linecolor=blue}
    \psparametricplot{-2}{2}{\X(t)|\Y(t)}
    \psparametricplot{-2}{2}{-\X(t)|\Y(t)}
\end{pspicture}
\end{document}
share|improve this answer
    
In this case, I don't know if a pstricks answer is really an appropriate alternative. The question was really about a specific bug in tikz. –  Ryan Reich Apr 16 '13 at 1:09
1  
@RyanReich: While the bug is being fixed, we can use it temporarily for emergency solution or permanently. –  cyanide-based food Apr 16 '13 at 1:13
3  
Well, the workaround is pretty simple (just use parentheses). Anyway, I'm not criticizing your answer, just musing on the purpose of adding a package-alternative answer to a question that is not general enough to be answered by an alternative package. This topic was recently raised in Meta, so it was on my mind. –  Ryan Reich Apr 16 '13 at 1:16

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.