子圖和標題放置

子圖和標題放置

我有5 個圖像要放置(使用subfigure 環境),我想將它們放置在兩列中(一列有3 個圖像,另一列有2 個),或兩行中(同上)並使用第六個圖像的空位置圖像將被用來放置標題。我怎樣才能做到這一點?

謝謝!

答案1

您可以使用subfigure子圖和 aminipage作為標題:

\documentclass{article}
\usepackage{graphicx, subcaption}

\begin{document}
\begin{figure}
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\hfill
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\hfill
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\par
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\hfill
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\hfill
    \begin{minipage}{.3\textwidth}
        \caption{a figure with six subfigures and a caption placed beside one of the subfigures}
    \end{minipage}
\end{figure}
\end{document}

在此輸入影像描述

\documentclass{article}
\usepackage{graphicx, subcaption}

\begin{document}
\begin{figure}
    \centering
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\quad
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\par
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\quad
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\par
    \begin{subfigure}{.3\textwidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{test subfigure}
    \end{subfigure}\quad
    \begin{minipage}{.3\textwidth}
        \caption{a figure with six subfigures and a caption placed beside one of the subfigures}
    \end{minipage}
\end{figure}
\end{document}

在此輸入影像描述

如果需要,請使用環境的可選參數來獲得所需的對齊方式。

相關內容