# Plots touching each other

I would like to create three box plots that touch each other (no space between boxes). I know that the problem are margins for ticks and labels (even if there are none), so I just don't know how to remove them.

MWE:

\documentclass{minimal}
\usepackage{pgfplots}

\pgfplotsset{compat=1.16}

\begin{document}

\begin{tikzpicture}
\begin{axis}[width=5cm,height=4cm,xlabel=$t$,ylabel=$p$,ticks=none,at={(0,0)}]
\end{axis}

\begin{axis}[width=5cm,height=4cm,xlabel=$t$,ticks=none,at={(5cm,0)}]
\end{axis}

\begin{axis}[width=5cm,height=4cm,xlabel=$t$,ticks=none,at={(10cm,0)}]
\end{axis}
\end{tikzpicture}

\end{document}


Is there any simple solution to this problem?

• You might also look at groupplots, [trim axis left] and [trim axis right] and possibly \pgfresetboundingbox. – John Kormylo Mar 23 at 15:48

scale only axis=true solved the problem.

I just posted if anyone else has the same problem. In case administrators think this is inappropriate, please erase the message.

I was playing with numbers and I got this. Is that ok for you?

 \documentclass{minimal}
\usepackage{pgfplots}

\pgfplotsset{compat=1.16}

\begin{document}
\begin{center}

\begin{tikzpicture}
\begin{axis}[width=5cm,height=4cm,xlabel=$t$,ylabel=$p$,ticks=none,at={(0,0)}]
\end{axis}

\begin{axis}[width=5cm,height=4cm,xlabel=$t$,ticks=none,at={(3.4cm,0cm)}]
\end{axis}

\begin{axis}[width=5cm,height=4cm,xlabel=$t$,ticks=none,at={(6.8cm,0)}]
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}


• I have already solved the problem. Please see the answer I posted two hours before yours. – Pygmalion Mar 23 at 15:08
• I saw it alrdy. Suit yourself! :) – Mannie Mar 23 at 15:16