width=33mm
我在 groupplot 中设置。这个宽度该怎么理解?
我以为应该是:“图形宽度”+标签距离,但好像是另一个值。
如何在 groupplot 中读出标签距离?
\documentclass[a4paper]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepgfplotslibrary{groupplots}
\begin{document}
\begin{tikzpicture}[]
\begin{groupplot}[group style={group size={2 by 2,},
horizontal sep=22mm, %vertical sep=1cm,
},
width=33mm,
y tick label style={draw},
ylabel style={draw},
]
\nextgroupplot[title={1}, ylabel=ylabel]
\addplot[]{x};
\nextgroupplot[title={2}, ylabel=ylabel]
\addplot[]{2*x};
\end{groupplot}
\draw[red, very thick] (group c1r1.south east) -- +(-33mm,0) node[midway, above, fill=yellow]{33mm};
% Does not work
%\pgfmathsetlengthmacro\ttt{\pgfkeysvalueof{/pgfplots/group/label distance}}
%\node[fill=yellow]{\ttt};
\end{tikzpicture}
\end{document}