Código

Código

Quiero usar 5 subfiguras, tres dispuestas en la primera fila y dos en la segunda fila, ambas filas deben estar dispuestas centralmente. Pero tengo un problema en la segunda fila, las dos imágenes están colocadas en cada extremo pero no hacia el centro. ¿Alguna forma de manejarlo?

\begin{figure*}[!htb]
\centering
\subfloat[Original Depth Image]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure1}
}
\hfill
\subfloat[Plausibility Map]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure2}
}
\hfill
\subfloat [Depth Image of Guided Filter]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure3}
}
\vfill
\centering
\subfloat[Blending Map]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure4}}
\hfill
\centering
\subfloat[Blended Output Depth Image]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure5}}
\caption{Results for Combination1: Plausibility Method-2 and Blending}
\end{figure*}

ingrese la descripción de la imagen aquí

Respuesta1

Simplemente juega algunos juegos con \hfily \hfill.

\documentclass{scrartcl}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure*}[!htb]
\centering
\subfloat[Original Depth Image]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure1}
}
\hfill
\subfloat[Plausibility Map]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure2}
}
\hfill
\subfloat [Depth Image of Guided Filter]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure3}
}
\vfill
\centering
\hfill\hfill\subfloat[Blending Map]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure4}}\hfill
\subfloat[Blended Output Depth Image]{
\includegraphics[width=.3\textwidth,height=4.0cm]{cat.png}
\label{fig:subfigure5}}\hfill\hfill\hfil
\caption{Results for Combination1: Plausibility Method-2 and Blending}
\end{figure*}
\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

He realizado algunos cambios en su ejemplo:

  • No es necesario repetirlo \centering, una vez es suficiente.
  • En lugar de confiar en la división automática dentro de la figura, utilicé una línea vacía explícita.
  • Los signos de comentario %al final de las líneas evitan espacios no deseados en el documento.
  • Para tener un espaciado consistente en la figura, utilicé a \hspace{.05\textwidth}para producir el espacio en blanco en la fila inferior.

Código

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}

\begin{document}
\begin{figure*}[!htb]\centering
\subfloat[Original Depth Image]{%
\includegraphics[width=.3\textwidth,height=4.0cm]{example-image}%
\label{fig:subfigure1}%
}%
\hfill
\subfloat[Plausibility Map]{%
\includegraphics[width=.3\textwidth,height=4.0cm]{example-image}%
\label{fig:subfigure2}%
}
\hfill
\subfloat [Depth Image of Guided Filter]{%
\includegraphics[width=.3\textwidth,height=4.0cm]{example-image}%
\label{fig:subfigure3}%
}

\subfloat[Blending Map]{%
\includegraphics[width=.3\textwidth,height=4.0cm]{example-image}%
\label{fig:subfigure4}}%
\hspace{.05\textwidth}%
\subfloat[Blended Output Depth Image]{%
\includegraphics[width=.3\textwidth,height=4.0cm]{example-image}%
\label{fig:subfigure5}}%
\caption{Results for Combination1: Plausibility Method-2 and Blending}
\end{figure*}
\end{document}

Resultado

resultado

información relacionada