子图中有两个图形

子图中有两个图形

我需要在同一页面中显示总共 8 个图形,按以下方式组合它们:

 img1-a img1-b
 img2-a img2-b
   (a)  (b)

 img1-c img1-d
 img2-c img2-d
   (c)  (d)

我尝试了子图,

\begin{figure*}[tpb]
\centering
\subfigure[]
      {\label{fig:conn}
      \includegraphics[width=0.48\columnwidth,keepaspectratio]{img1-a}
      \includegraphics[width=0.48\columnwidth,keepaspectratio]{img1-a}}\hfill

\subfigure[]
//and so on....

但我不明白如何将两个图形合并到同一列(即图形 img1-a 和 img2-a)。也许可以强制子图宽度?任何帮助都将不胜感激!

答案1

您可以使用 minipage 将必须放在同一子图中同一列中的图像组合起来。出于某些特殊原因,我无法在 subfigure 中实现此功能。但此代码应该会为您提供 subfig 包所需的输出。

\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}

    \begin{figure}[tpb]
        \centering
        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1a}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2a}
            \end{minipage}} 
        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1b}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2b}
            \end{minipage}} 

        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1c}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{1d}
            \end{minipage}}  
        \subfloat[]{
            \begin{minipage}{0.5\linewidth}
                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2c}

                \includegraphics[width=0.98\linewidth, height = 0.2\textheight, keepaspectratio=true]{2d}
            \end{minipage}} 
    \end{figure}
\end{document}

注意不要在这里删除白线,因为这会影响浮点数的间距。

答案2

subfig使用和的解决方案floatrow 全局标题

\documentclass{article}
\usepackage{subfig} %must be loaded before floatrow, since i loads caption
\usepackage{floatrow}
\usepackage{graphicx}
\begin{document}

\begin{figure}
\ffigbox[\FBwidth]{%
\begin{subfloatrow}
\includegraphics{img1-a}\quad
\includegraphics{img1-b}
\end{subfloatrow}

\begin{subfloatrow}
\ffigbox[\FBwidth]{\caption{}\label{subfig:a}\includegraphics{img2-a}}{}
\ffigbox[\FBwidth]{\caption{}\label{subfig:b}\includegraphics{img2-b}}{}
\end{subfloatrow}
\vspace{10pt}
\begin{subfloatrow}
\includegraphics{img1-c}\quad
\includegraphics{img1-d}
\end{subfloatrow}

\begin{subfloatrow}
\ffigbox[\FBwidth]{\caption{}\label{subfig:c}\includegraphics{img2-c}}{}
\ffigbox[\FBwidth]{\caption{}\label{subfig:d}\includegraphics{img2-d}}{}
\end{subfloatrow}}
{\caption{now with caption}\label{fig:figures}}
\end{figure}

\end{document}

相关内容