TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}
share|improve this question

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.)

share|improve this answer

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.