我想在下图左侧(我放置红色标记的地方)添加文本,例如“我的 Y 变量”:
以下是我目前得到的 MWE:
\documentclass{article}
\usepackage[luatex]{graphicx}
\usepackage{subcaption}
\captionsetup{subrefformat=parens}
\captionsetup[subfigure]{aboveskip=5pt,belowskip=20pt}
\begin{document}
\begin{figure}
\centering
\subcaptionbox{A1}[.48\textwidth]{\includegraphics[scale=0.25]{example-image-a}}
\subcaptionbox{A2}[.48\textwidth]{\includegraphics[scale=0.25]{example-image-a}}
\subcaptionbox{A3}[.48\textwidth]{\includegraphics[scale=0.25]{example-image-a}}
\subcaptionbox{A4}[.48\textwidth]{\includegraphics[scale=0.25]{example-image-a}}
My x variable
\caption{Whatever caption here}
\end{figure}
\end{document}
有人有想法吗?我想 tikz 可能是一个选择,但我愿意接受任何更简单的选择!
答案1
如果我正确理解了你的意思,那么你正在寻找这样的东西:
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption, subcaption}
\begin{document}
\begin{figure}[htb]
\centering
\setkeys{Gin}{width=0.45\linewidth}
\begin{minipage}{0.05\linewidth}\centering
\rotatebox[origin=center]{90}{My y variable}
\end{minipage}\begin{minipage}{0.9\linewidth}\centering
\subfloat[A1]{\includegraphics{example-image-a}}
\hfil
\subfloat[A2]{\includegraphics{example-image-b}}
\subfloat[A3]{\includegraphics{example-image-a}}
\hfil
\subfloat[A4]{\includegraphics{example-image-b}}
My x variable
\end{minipage}
\caption{Whatever caption here}
\end{figure}
\end{document}