Is there a simple way of making a common x-axis label?
I have referred to this:
Common x-axis label in different rows of pgfplots mult
and the solution appears very complex and doesn't work for me.
Here is a my MWE:
\documentclass{standalone}
\usepackage{siunitx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage[sfdefault]{atkinson}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel={Work},
ylabel={Effort},
title={Graphpart 1}]
\addplot[no marks]{x^2+x+2};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[xlabel={Work},
ylabel={Effort},
title={Graphpart 2}]
\addplot[only marks, red, mark size=1pt]{x^3+x+2};
\end{axis}
\end{tikzpicture}
\end{document}
I would like Work
to be in the centre as the common x-axis label.
Best Answer
You really should use a
groupplot
. But, for now you can use a slightly hackish method and that is to usexlabel style
to position thexlabel
:A
\vphantom{}
was applied to the first graph'sxlabel
to ensure that the x-axis was located at the same spot vertically.Code: