1

I just started using LaTeX and need some assistance creating a diagram like this. Except I don't need multiple hyperbolas, just one. My trouble is making the hyperbolas using \addplot. I was able to make the simple lines using \draw but I was told \addplot is better so I want to learn it that way too. Can anyone give me a place to start?

Minkowski diagram

closed as unclear what you're asking by Svend Tveskæg, user13907, Mico, Henri Menke, Martin Schröder May 12 '15 at 10:06

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Weclome to TeX Stackexchange! It makes it much easier to help you if you add the code that can be compiled (minimal working example (MWE)) and some more details of what you tried so far and why it failed. – jens_bo May 12 '15 at 7:41
  • 3
    And in a very general sense, places to start would be the pgfplots manual. Which should help you draw everything but the hyperbolas. If you only need one, which one would it be? Or one in each, the past, future, and the space like areas? – jens_bo May 12 '15 at 7:46
5

You can use the different domains of definition to draw the parts of hyperbolas but it needs a little bit of adjustment to match the vertices (or you can find another parametric form that doesn't have this problem).

I chose 3,4 to be x,y scaling values in hyperbola formula. The details can be found in the very comprehensive pgfplots manual. Note that \draw,\fill and so on are TikZ commands. \addplot comes with the package pgfplots which is built on TikZ. So there is some interplay you need to sort out in your head.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[no marks,grid]
\addplot {sqrt(3^2*(1+(x/4)^2))};
\addplot {-sqrt(3^2*(1+(x/4)^2))};
\begin{scope}[samples=351]
\addplot+[domain=1.33339:5] {sqrt(3^2*((x/4)^2)-1)};
\addplot+[domain=-5:-1.33333] {sqrt(3^2*((x/4)^2)-1)};
\pgfplotsset{cycle list shift=-2} % To match the color of the second previous cure
\addplot+[domain=1.33339:5] {-sqrt(3^2*((x/4)^2)-1)};
\addplot+[domain=-5:-1.33333] {-sqrt(3^2*((x/4)^2)-1)};
\addplot[thick] {3/4*x};
\addplot[thick] {-3/4*x};
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

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