垂直放置子图

垂直放置子图

我想使用子图来放置三个如下的图形:

左边一个形状右边两个形状

以下是我使用的代码:

\begin{figure}
\begin{tabular}{|c|c|}
\hline
\multirow{2}{*}{
        \begin{subfigure}[h]{0.3\textwidth}
                \centering
                \includegraphics{Fig2}
                \caption{Argumentation Framework $I$}
                \label{fig:afexampleI}
        \end{subfigure}
               }
        &
         \begin{subfigure}[h]{0.6\textwidth}
             \centering
             \includegraphics{Fig3}
             \caption{Argumentation Framework $III$}
             \label{fig:afexampleIII}
         \end{subfigure} \\
        &
         \begin{subfigure}[h]{0.6\textwidth}
             \centering
             \includegraphics{Fig4}
             \caption{Argumentation Framework $II$}
             \label{fig:afexampleII}
         \end{subfigure} \\
\hline
\end{tabular}
\caption{Argumentation Frameworks}\label{fig:afexample}
\end{figure}

但结果却是这样的:

在此处输入图片描述

PS 我使用它是\hline为了更好地说明图形,否则所tabular用环境应该没有边框。

答案1

要获得三个具有所需布局的独立图形,您可以使用minipage

\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}
\begin{minipage}[c][11cm][t]{.5\textwidth}
  \vspace*{\fill}
  \centering
  \includegraphics[width=5cm,height=10cm]{image1}
  \caption{test figure one}
  \label{fig:test1}
\end{minipage}%
\begin{minipage}[c][11cm][t]{.5\textwidth}
  \vspace*{\fill}
  \centering
  \includegraphics[width=5cm,height=4.5cm]{image1}
  \caption{test figure two}
  \label{fig:test2}\par\vfill
  \includegraphics[width=5cm,height=4.5cm]{image1}
  \caption{test figure three}
  \label{fig:test3}
\end{minipage}
\end{figure}

\end{document}

在此处输入图片描述

要将这三个图像作为子图,您只需在前面的代码中用(来自包)\caption替换即可:\subcaptionsubcaption

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}

\begin{document}

\begin{figure}
\begin{minipage}[c][11cm][t]{.5\textwidth}
  \vspace*{\fill}
  \centering
  \includegraphics[width=5cm,height=10cm]{image1}
  \subcaption{test figure one}
  \label{fig:test1}
\end{minipage}%
\begin{minipage}[c][11cm][t]{.5\textwidth}
  \vspace*{\fill}
  \centering
  \includegraphics[width=5cm,height=4.5cm]{image1}
  \subcaption{test figure two}
  \label{fig:test2}\par\vfill
  \includegraphics[width=5cm,height=4.5cm]{image1}
  \subcaption{test figure three}
  \label{fig:test3}
\end{minipage}
\end{figure}

\end{document}

在此处输入图片描述

选项demo只是graphicx用黑色矩形替换实际图形;不是在实际文档中使用该选项。

答案2

一个subfig办法:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}

\newsavebox{\bigleftbox}

\begin{document}

\begin{figure}
\centering
\sbox{\bigleftbox}{%
  \begin{minipage}[b]{.5\textwidth}
  \centering
  \vspace*{\fill}
  \subfloat[test figure one]
    {\includegraphics[width=5cm,height=10cm]{image1}\label{fig:test1}}
  \end{minipage}%
}\usebox{\bigleftbox}%
\begin{minipage}[b][\ht\bigleftbox][s]{.5\textwidth}
\centering
\subfloat[test figure two]
  {\includegraphics[width=5cm,height=4.5cm]{image1}\label{fig:test2}}

\vfill

\subfloat[test figure three]
  {\includegraphics[width=5cm,height=4.5cm]{image1}\label{fig:test3}}
\end{minipage}
\end{figure}

\end{document}

左边的大子图已经测量并排版完毕,因此我们可以将右边的框的高度设置为与左边的框的高度完全相同。

在此处输入图片描述

答案3

如果您不想使用子图,您也可以使用 minipages,因此结果看起来更像问题中的示例:

在此处输入图片描述

\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[htbp]
\begin{minipage}{0.5\linewidth}
\centering
\includegraphics[width=5cm,height=10cm]{image1}
\caption{A Circle}
\label{fig:circle}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{test subfigure two}
\label{fig:test2}\par \medskip \vfill
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{test subfigure three}
\label{fig:test3}
\end{minipage}
\end{figure}

\end{document}

答案4

使用tabular+ subcaption

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\begin{document}

\begin{figure}
\begin{tabular}[b]{p{5cm}}
 \includegraphics[width=5cm,height=10cm]{image1}\\     
 \subcaption{test figure one}
\end{tabular}
\begin{tabular}[b]{p{5cm}}
 \includegraphics[width=5cm,height=5cm]{image2}\\  
 \subcaption{test figure 2}\\     
 \includegraphics[width=5cm,height=5cm]{image1}\\     
 \subcaption{test figure three}
\end{tabular}
 \caption{figure}
\end{figure}

\end{document}

得出:

在此处输入图片描述

相关内容