将两个嵌套图形组合在一起

将两个嵌套图形组合在一起

我有两个由 4 个 (2x2) 组成的图形subfigure。它们都看起来像这样:

\begin{figure}[htb!]
        \centering
        \begin{subfigure}[b]{0.24\textwidth}
            \centering
            \includegraphics[scale=0.23]{figures/1.pdf}
            \caption{{subfigure 1}}    
            \label{fig:subfigure1}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.24\textwidth}  
            \centering 
            \includegraphics[scale=0.23]{figures/2.pdf}
            \caption{{subfigure 2}}     
            \label{fig:subfigure2}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.23\textwidth}   
            \centering 
            \includegraphics[scale=0.23]{figures/3.pdf}
            \caption{{subfigure 3}}    
            \label{fig:subfigure3}
        \end{subfigure}
        \quad
        \begin{subfigure}[b]{0.23\textwidth}   
            \centering 
            \includegraphics[scale=0.23]{figures/4.pdf}
            \caption{{subfigure 4}}    
            \label{fig:subfigure4}
        \end{subfigure}
        \caption{first set of 4 subfigures.} 
        \label{fig:4subfigures_1}
    \end{figure}

现在,由于文档采用2列格式,我希望一组这样的2x2子图出现在另一组旁边,最好是在顶部。

有什么简单的方法可以将它们组合在一起?

答案1

可能是這樣嗎?

\documentclass[twocolumn]{article}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{kantlipsum}
\begin{document}
  \kant[1-4]
  \begin{figure*}[htb!]
        \centering
        \begin{minipage}{0.48\linewidth}
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{{subfigure 1}}
            \label{fig:subfigure1}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{{subfigure 2}}
            \label{fig:subfigure2}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{{subfigure 3}}
            \label{fig:subfigure3}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{{subfigure 4}}
            \label{fig:subfigure4}
        \end{subfigure}
        \caption{first set of 4 subfigures.}
        \label{fig:4subfigures_1}
  \end{minipage}
  \hfill
  \begin{minipage}{0.48\textwidth}
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image}
            \caption{{subfigure 1}}
            \label{fig:subfigure1}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{{subfigure 2}}
            \label{fig:subfigure2}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.48\textwidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{{subfigure 3}}
            \label{fig:subfigure3}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.48\textwidth}
            \centering
            \includegraphics[width=\linewidth]{example-image-c}
            \caption{{subfigure 4}}
            \label{fig:subfigure4}
        \end{subfigure}
        \caption{first set of 4 subfigures.}
        \label{fig:4subfigures_1}
  \end{minipage}
    \end{figure*}
    \kant[1-20]
\end{document}

在此处输入图片描述

相关内容