![sidewaysfigure 中的两行图形未正确垂直对齐](https://linux22.com/image/343257/sidewaysfigure%20%E4%B8%AD%E7%9A%84%E4%B8%A4%E8%A1%8C%E5%9B%BE%E5%BD%A2%E6%9C%AA%E6%AD%A3%E7%A1%AE%E5%9E%82%E7%9B%B4%E5%AF%B9%E9%BD%90.png)
我正在尝试创建两个图形面板,每个面板都有一个标题。但是,我无法同时将底部面板的标题居中并将底部图形与顶部图形对齐。在此示例中,图形未对齐,但文本 (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}