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

2
  • 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, 2017 at 18:56
  • See also tex.stackexchange.com/q/213075/124842
    – Bobyandbob
    Mar 28, 2017 at 19:06

1 Answer 1

4

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

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .