等尺寸子图

等尺寸子图

我希望我的子图看起来统一,因此每个子图都具有相同的宽度和高度。此外,两行中的每一行都应该有一个中心,该行中的所有子图都围绕该中心居中。

我希望这能够自动发生,而无需摆弄高度、宽度和比例参数,直到一切都适合。

我的代码:

\documentclass{article}
\usepackage[abs]{overpic}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{siunitx}
\begin{document}

\iffalse
\begin{overpic}[grid,tics=10,width=\textwidth]{pictures/reflectors/whiteboard-back/frontal.jpg}
\end{overpic}
\vskip 1cm
\begin{overpic}[grid,tics=10,trim=20 10 20 0,width=\textwidth]{pictures/reflectors/whiteboard-back/frontal.jpg}
\end{overpic}
\vskip 1cm
\begin{overpic}[grid,tics=10,trim=20 10 20 0,clip,width=\textwidth]{pictures/reflectors/whiteboard-back/frontal.jpg}
\end{overpic}
\fi

\begin{figure}
\subfloat[\SI{30}{\degree} left]{\includegraphics[height=0.4\textwidth]{results/rp/glassdoor-aac-30deg_left_rp.pdf}} \qquad
\subfloat[\SI{30}{\degree} right]{\includegraphics[height=0.4\textwidth]{results/rp/glassdoor-aac-30deg_right_rp.pdf}} \qquad
\subfloat[\SI{60}{\degree} left]{\includegraphics[height=0.4\textwidth]{results/rp/glassdoor-aac-60deg_left_rp.pdf}} \qquad
\subfloat[\SI{60}{\degree} right]{\includegraphics[height=0.4\textwidth]{results/rp/glassdoor-aac-60deg_right_rp.pdf}} \qquad
\subfloat[\SI{90}{\degree}]{\includegraphics[height=0.4\textwidth]{results/rp/glass-door-90deg_rp.pdf}} \qquad
\subfloat[Measurement location]{\includegraphics[angle=-90,origin=c,height=0.4\textwidth]{pictures/reflectors/glassdoor/frontal.jpg}} \qquad
\caption{Range measurements for clear glass at 30,60,90 degree angles of incidence from the left and the right side}
\label{fig:rp_glassdoor}
\end{figure}


\end{document}

示例输出

答案1

这是我建议的答案(尽管有点冗长)。 在此处输入图片描述


\documentclass{article}
    \usepackage{graphicx}
    \usepackage{subfig}
    \usepackage{siunitx}
    \usepackage{adjustbox}
\begin{document}

\begin{figure}
    \begin{minipage}[c]{\textwidth}
        \begin{minipage}[t]{0.4\textwidth}
            \centering
            \subfloat[\SI{30}{\degree} left]{\includegraphics[height=\textwidth]{example-image-a}}
        \end{minipage}
        \hfill
        \begin{minipage}[t]{0.4\textwidth}
            \centering
            \subfloat[\SI{30}{\degree} right]{\includegraphics[height=\textwidth]{example-image-a}}
        \end{minipage}
    \end{minipage}

    \begin{minipage}[c]{\textwidth}
        \begin{minipage}[t]{0.4\textwidth}
            \centering
            \subfloat[\SI{60}{\degree} left]{\includegraphics[height=\textwidth]{example-image-a}}
        \end{minipage}
        \hfill
        \begin{minipage}[t]{0.4\textwidth}
            \centering
            \subfloat[\SI{60}{\degree} right]{\includegraphics[height=\textwidth]{example-image-a}}
        \end{minipage}
    \end{minipage}

    \begin{minipage}[c]{\textwidth}
        \adjustbox{valign=t}{
            \begin{minipage}[t]{0.4\textwidth}
                \centering
                \subfloat[\SI{90}{\degree}]{\includegraphics[height=\textwidth]{example-image-a}}
            \end{minipage}
        }
        \adjustbox{valign=t, center}{
            \begin{minipage}{0.4\textwidth}% 
                \subfloat[Measurement location]{\includegraphics[angle=-90, origin=c, height=\textwidth, width = 0.75\textwidth,  keepaspectratio]{example-image-b}}%
            \end{minipage}
        }
    \end{minipage}

\caption{Range measurements for clear glass at 30,60,90 degree angles of incidence from the left and the right side}
\label{fig:rp_glassdoor}
\end{figure}
\end{document}

答案2

这是一个更简单的解决方案。我使用 \tempheight 来均衡高度,使用 \raisebox 来对齐底部。唯一需要调整的是适合页面。

\documentclass{article}
    \usepackage{graphicx}
    \usepackage{siunitx}
    \usepackage{showframe}% check centering
    \newlength{\tempheight}
\begin{document}

\begin{figure}
  \settoheight{\tempheight}{\includegraphics[width=0.4\textwidth]{example-image-a}}
  \hfil\begin{tabular}{cc}
      \includegraphics[width=0.4\textwidth]{example-image-a} &
        \includegraphics[width=0.4\textwidth]{example-image-a} \\
      \SI{30}{\degree} left & \SI{30}{\degree} right \\[1ex]
      \includegraphics[width=0.4\textwidth]{example-image-a} &
        \includegraphics[width=0.4\textwidth]{example-image-a} \\
      \SI{60}{\degree} left & \SI{60}{\degree} right \\[1ex]
      \includegraphics[width=0.4\textwidth]{example-image-a} &
        \raisebox{\depth}{\includegraphics[width=\tempheight, angle=-90]{example-image-b}} \\
      \SI{90}{\degree} & Measurement location
  \end{tabular}
\caption{Range measurements for clear glass at 30,60,90 degree angles of incidence from the left and the right side}
\label{fig:rp_glassdoor}
\end{figure}
\end{document}

演示

相关内容