0

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
1

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.

| improve this answer | |
0

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}

enter image description here

| improve this answer | |
  • 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

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.