
5 つのサブ図を使用したいのですが、最初の行に 3 つ、2 番目の行に 2 つ配置し、両方の行を中央に配置する必要があります。しかし、2 番目の行で問題が発生しています。2 つの画像が両端に配置されていますが、中央には配置されていません。対処方法はありますか?
\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*}
答え1
\hfil
とでゲームをいくつかプレイするだけです\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}
答え2
例にいくつか変更を加えました:
- を繰り返す必要はなく
\centering
、1回で十分です。 - 図内での自動改行に頼る代わりに、明示的な空行を使用しました。
%
行末のコメント記号は、ドキュメント内の不要なスペースを防ぎます。- 図の間隔を一定に保つために、
\hspace{.05\textwidth}
下の行に空白を作成するために a を使用しました。
コード
\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}