2 つの異なる行にあるサブ図の間隔が不均一ですか?

2 つの異なる行にあるサブ図の間隔が不均一ですか?

8 つのサブ図を 2 行に重ねて、ページ上で垂直に一致させようとしています。しかし、上の行はページ全体で均等に間隔が空いているように見えますが、下の行は均等に間隔が空いていますが、間隔がずっと小さいです。私は TEX にあまり詳しくないので、コードがひどい場合はお手柔らかにお願いします。

\documentclass[10pt,a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\newsubfloat{figure}
\begin{document}
\begin{figure}[ht!]
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\begin{minipage}{0.23\textwidth}
\centering
\subtop[]{\includegraphics[height=0.16\textheight]{Figures/Q1.png}\label{sf:Q1}}
\end{minipage}
\caption[contents]{caption}
\label{fig:Qual}
\end{figure}
\end{document}

各 sf のコードをコピーして貼り付けたので、各行で異なる動作をするのはなぜかわかりません。8 つの画像はすべて同じ解像度 (1780x1752) です。明らかに何か簡単なことを見逃しています... 何か助けていただけますか?

答え1

画像の幅がミニページの幅よりも広いです。画像の幅をミニページの幅に合わせると、画像が重なり合うことがなくなります。参照:

\documentclass[10pt,a4paper]{memoir} \usepackage[utf8]{inputenc}
\usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb}
\usepackage{graphicx} \newsubfloat{figure} \begin{document}
\begin{figure}[ht!] \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage}

\begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \begin{minipage}{0.23\textwidth} \centering
\subtop[]{\includegraphics[width=\hsize]{example-image}\label{sf:Q1}}
\end{minipage} \caption[contents]{caption} \label{fig:Qual}
\end{figure} \end{document}

この場合、ミニページを省略して、図に直接イメージを挿入することができます。次のようになります。

\subtop[]{\includegraphics[width=0.23\hsize]{example-image}\label{sf:Q1}}\hfill
\subtop[]{\includegraphics[width=0.23\hsize]{example-image}\label{sf:Q1}}\hfill
\subtop[]{\includegraphics[width=0.23\hsize]{example-image}\label{sf:Q1}}\hfill
\subtop[]{\includegraphics[width=0.23\hsize]{example-image}\label{sf:Q1}}

最初の 3 つの画像の後に \hfill を追加すると、画像間のギャップが広くなります。

元の画像がないので、サンプル画像を使用します。下の図では、最初の 4 つの画像はミニページなしでコードによって生成され、画像間に \hfill が導入されています。 ここに画像の説明を入力してください

編集: もちろん、画像を手動で 2 行に分割しました。

関連情報