Espaçamento irregular entre subfiguras em 2 linhas diferentes?

Espaçamento irregular entre subfiguras em 2 linhas diferentes?

Estou tentando empilhar 8 subfiguras em 2 linhas para que correspondam verticalmente na página. No entanto, a linha superior parece espaçada uniformemente na página e a linha inferior está espaçada uniformemente, mas a lacuna é bem menor. Sou um pouco novo no tex, então vá com calma se meu código for horrível.

\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}

Copiei e colei o código de cada sf, então não entendo por que ele agiria de maneira diferente em cada linha. Todas as 8 imagens têm resolução idêntica (1780x1752). Claramente estou sentindo falta de algo simples...alguma ajuda?

Responder1

Suas imagens são maiores que a largura das minipáginas. Se você acomodar a largura das imagens à largura das minipáginas, as imagens não serão mais sobrepostas. Ver:

\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}

Neste caso você pode omitir as minipáginas e colocar as imagens diretamente na sua figura. Algo assim:

\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}}

Com \hfill adicionado após as três primeiras imagens, obtenho um espaço maior entre elas.

Como não tenho suas imagens originais, uso imagens de exemplo. Na figura abaixo as primeiras quatro imagens são geradas por código sem minipáginas e introduzidas \hfill entre as imagens. insira a descrição da imagem aqui

Editar: Claro, dividi manualmente as imagens em duas linhas.

informação relacionada