sidewaysfigure 中的两行图形未正确垂直对齐

sidewaysfigure 中的两行图形未正确垂直对齐

我正在尝试创建两个图形面板,每个面板都有一个标题。但是,我无法同时将底部面板的标题居中并将底部图形与顶部图形对齐。在此示例中,图形未对齐,但文本 (b) 为:

\begin{sidewaysfigure}
\centering
\caption{\large Distribution of the W statistic}\par\medskip
\label{w_c}
  \begin{center}{(a) Singh-Madalla with c=1.7 }\end{center}
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_1_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_2_fim2.pdf}\quad
  \begin{center}{(b) Singh-Madalla with c=1.2 }\end{center}%\newline
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_1_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_2_fim2.pdf}
\end{sidewaysfigure}  

在这个例子中,底部的 4 个图形与顶部的 4 个图形对齐,但文本居中:

\begin{sidewaysfigure}
\centering
    \caption{\large Distribution of the W statistic}\par\medskip
    \label{w_c}
  \begin{center}{(a) Singh-Madalla with c=1.7 }\end{center}
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_1_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_2_fim2.pdf}\quad
  {(b) Singh-Madalla with c=1.2 }\newline
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_0_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_1_fim2.pdf}\quad
  \includegraphics[width=0.23\textheight]{ge_2_fim2.pdf}
\end{sidewaysfigure}

如何获得这两个部分?

谢谢!

答案1

两条评论/建议:

  • 不要使用\quad来分隔图表;\hfill而要使用。并且,只使用三条\hfill指令,而不是四条。

  • 不要进行过多的视觉格式化,例如,在设置子图的标题时。相反,使用包subcaption及其subfigure环境;它提供了自己的\caption语句,它将自动居中并编号(a),(b)等。

在此处输入图片描述

\documentclass[demo]{article} % omit 'demo' option in real doc.
\usepackage{graphicx,rotating,subcaption}
\begin{document}
\begin{sidewaysfigure}
\caption{Distribution of the $W$ statistic} \label{w_c}
  \begin{subfigure}{\textwidth}
  \caption{Singh-Madalla with $c=1.7$} \label{w_c_1.7}
  \includegraphics[width=0.23\textwidth]{ge_0_fim2.pdf}\hfill
  \includegraphics[width=0.23\textwidth]{ge_0_fim2.pdf}\hfill
  \includegraphics[width=0.23\textwidth]{ge_1_fim2.pdf}\hfill
  \includegraphics[width=0.23\textwidth]{ge_2_fim2.pdf}
  \end{subfigure}

  \bigskip
  \begin{subfigure}{\textwidth}
  \caption{Singh-Madalla with $c=1.2$} \label{w_c_1.2}
  \includegraphics[width=0.23\textwidth]{ge_0_fim2.pdf}\hfill
  \includegraphics[width=0.23\textwidth]{ge_0_fim2.pdf}\hfill
  \includegraphics[width=0.23\textwidth]{ge_1_fim2.pdf}\hfill
  \includegraphics[width=0.23\textwidth]{ge_2_fim2.pdf}
  \end{subfigure} 
\end{sidewaysfigure} 
\end{document}

相关内容