6개의 이미지를 두 행(각 행에 3개의 이미지)으로 배치하는 코드가 있습니다.
\begin{figure}[htbp!]
\centering
\begin{subfigure}[b]{0.3 \textwidth}
\includegraphics[width=\textwidth]{1agw-eva.png}
\caption{Cec\_2021\_ Function 1}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{2agw-eva.png}
\caption{Cec\_2021\_ Function 2}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{3agw-eva.png}
\caption{Cec\_2021\_ Function 3}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{4agw-eva.png}
\caption{Cec\_2021\_ Function 5}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{5agw-eva.png}
\caption{Cec\_2021\_ Function 7}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{6agw-eva.png}
\caption{Cec\_2021\_ Function 8}
\end{subfigure}
\hfill
\begin{subfigure}[t]{0.9\textwidth}
\centering
\includegraphics[width=\textwidth]{7agw-eva.png}
\caption{Cec\_2021\_ Function 3}
\end{subfigure}
\caption{caption.}
\label{fig:fig-evaluation}
\end{figure}
그러나 수직 위치로 표시됩니다.
답변1
이것은 잘 작동합니다. 새 단락을 시작하는 빈 줄에 주의하십시오. 따라서 로 끝나는 줄에는 빈 줄이 있어서는 안 됩니다 \hfill
.
\documentclass[a4paper]{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp!]
\centering
\begin{subfigure}[b]{0.3 \textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 1}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 2}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 3}
\end{subfigure}
\medskip
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 5}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 7}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering \includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 8}
\end{subfigure}
\medskip
\begin{subfigure}[t]{0.9\textwidth}
\centering \includegraphics[width=\textwidth]{example-image}
\caption{Cec\_2021\_ Function 3}
\end{subfigure}
\caption{Convergence curves for AGWO and other recent algorithms
during 2500 iterations.}
\label{fig:agwo-evaluation}
\end{figure}
\end{document}