2

How can I align two tikzpictures on the same line? There are several suggestions but the trivial approach suggested in:

How to draw two Tikz pictures that are parallel to each other?

does not work for me.

\documentclass[12pt,a4paper]{article}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}

\begin{document}
    \begin{tikzpicture}
        \begin{axis}[hide axis,axis equal]
            \addplot3[surf,domain=0:360,y domain=-2:2]
                ({cosh(y)*cos(x)},{cosh(y)*sin(x)},{sinh(y)});
        \end{axis}
    \end{tikzpicture}

    \begin{tikzpicture}
        \begin{axis}[hide axis,axis equal]
            \addplot3[surf,domain=0:360,y domain=-2:2]
                ({cosh(y)*cos(x)},{cosh(y)*sin(x)},{sinh(y)});
        \end{axis}
    \end{tikzpicture}

\end{document}

Which simply stacks the images:

StackedImages

  • 3
    The empty line between tikzpictures forces them to be on two different paragraphs. Insert % between them or just suppress empty line, and both will remain on same line. – Ignasi Mar 28 '17 at 18:56
  • See also tex.stackexchange.com/q/213075/124842 – Bobyandbob Mar 28 '17 at 19:06
3

Remove the empty line between the two tikzpictures. It separates the two images into separate paragraphs, hence the stacking.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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