4

I created a figure with four subfigures (two rows of two subfigures) where each subfigure has a caption below the subfigure. Strangely, the captions for the subfigures in the top row are partially covered by the subfigures in the second row. I can't seem to figure out why that is or how to fix it. An example of the code is given below.

\begin{figure}[ht!]
\begin{center}
\subfigure[$k$~$=$~0.1]{\label{fig:1}\includegraphics[scale=0.4]{Fig1}}
\subfigure[$k$~$=$~0.5]{\label{fig:2}\includegraphics[scale=0.4]{Fig2}} \\
\subfigure[$k$~$=$~1.0]{\label{fig:3}\includegraphics[scale=0.4]{Fig3}}
\subfigure[$k$~$=$~2.0]{\label{fig:4}\includegraphics[scale=0.4]{Fig4}} 
\end{center}
\caption{Plots.}
\label{fig:Figs}
\end{figure}

2 Answers 2

3

It seems that the borders of the figures itself are not correct. An easy way to check this is to surround each one with a \fbox, e.g. replacing \includegraphics[scale=0.4]{Fig1} with \fbox{\includegraphics[scale=0.4]{Fig1}}.

(Something different: I recommend using \centering instead of \begin{center}...\end{center} because the latter one will produce unwanted vertical space between figure contents and caption.)

2

I have no problem with your code. Inserted

\hfill

to fill gap between figures of the same row. Below is what I did with different figure packages:

First: deprecated package-

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfigure}

\begin{document}
\begin{figure}[ht!]
\begin{center}
\subfigure[$k$~$=$~0.1]{\label{fig:1}\includegraphics[scale=0.4]{Fig1}} \hfill
\subfigure[$k$~$=$~0.5]{\label{fig:2}\includegraphics[scale=0.4]{Fig2}} \\
\subfigure[$k$~$=$~1.0]{\label{fig:3}\includegraphics[scale=0.4]{Fig3}} \hfill
\subfigure[$k$~$=$~2.0]{\label{fig:4}\includegraphics[scale=0.4]{Fig4}} 
\end{center}
\caption{Plots.}
\label{fig:Figs}
\end{figure}
\end{document}

Second: with subfig package

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}

\begin{document}
\begin{figure}[ht!]
\begin{center}
\subfloat[$k$~$=$~0.1]{\label{fig:1}\includegraphics[scale=0.4]{Fig1}} \hfill
\subfloat[$k$~$=$~0.5]{\label{fig:2}\includegraphics[scale=0.4]{Fig2}} \\
\subfloat[$k$~$=$~1.0]{\label{fig:3}\includegraphics[scale=0.4]{Fig3}} \hfill
\subfloat[$k$~$=$~2.0]{\label{fig:4}\includegraphics[scale=0.4]{Fig4}} 
\end{center}
\caption{Plots.}
\label{fig:Figs}
\end{figure}
\end{document}

Third: with subcaption package - little modification is made here to OP's code to remove redundancy string

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[ht!]
\begin{center}
\subcaptionbox{$k=0.1$\label{fig:1}}{\includegraphics[scale=0.4]{Fig1}} \hfill
\subcaptionbox{$k=0.5$\label{fig:2}}{\includegraphics[scale=0.4]{Fig2}} \par
\vspace{0.5cm}
\subcaptionbox{$k=1.0$\label{fig:3}}{\includegraphics[scale=0.4]{Fig3}} \hfill
\subcaptionbox{$k=2.0$\label{fig:4}}{\includegraphics[scale=0.4]{Fig4}} 
\end{center}
\caption{Plots.}
\label{fig:Figs}
\end{figure}
\end{document}
2
  • It seems in your third solution, you have to use \vspace{} to prevent the second row covering captions of the first row?
    – Samuel Li
    Jun 7, 2019 at 22:38
  • 1
    @Samuel Li, yes. That's another choice while using \par' - paragraph break however you can use line break \\' like other solutions either
    – Khaaba
    Jun 8, 2019 at 1:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .