[Tex/LaTex] Not aligned figures!

floatsvertical alignment

I have a problem aligning my figures. I am using following code. However, one figure appears a bit higher than the other one. Everything else is perfectly aligned in the paper. Except for these two:

\begin{figure*}
\begin{minipage}[b]{2.5in}
\centering
\includegraphics[width=2.8in]{P}
 \caption{P is a figure.}
\label{figure:p}
\end{minipage}
\hspace{0.21in}
\begin{minipage}[b]{2.5in}
\centering
 \includegraphics[width=2.8in]{D}
 \caption{D is a figure.}
\label{figure:d}
\end{minipage}
%\end{center}
\end{figure*}

Best Answer

You've not given us much go to on. Nevertheless I'm going to go out on a limb here and make some guesses about what might be going on.

According to your comments, the height of the two images is the same. In that case, there's nothing in your partial example that should result in misaligned images. Here's your partial example built into a MWE as follows

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage[demo]{graphicx}
\usepackage{subfigure}
\pagestyle{empty}
\usepackage{lipsum}
\begin{document}

\lipsum[1]

\begin{figure*}
  \begin{minipage}[b]{2.5in}
    \centering
    \includegraphics[width=2.28in]{P}
    \caption{P is a figure.}
    \label{figure:p}
  \end{minipage}
  \hspace{0.21in}
  \begin{minipage}[b]{2.5in}
    \centering
    \includegraphics[width=2.28in]{D}
    \caption{D is a figure.}
    \label{figure:d}
  \end{minipage}
\end{figure*}

\lipsum[2]

\end{document}

enter image description here

A possible issue might be that the contents of the caption might have different heights and depths. Here's a rather extreme example of what I'm referring to:

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage[demo]{graphicx}
\usepackage{subfigure}
\pagestyle{empty}
\usepackage{lipsum}
\begin{document}

\lipsum[1]

\begin{figure*}
  \begin{minipage}[b]{2.5in}
    \centering
    \includegraphics[width=2.28in]{P}
    \caption{P is a figure.\protect\rule[-2ex]{0.4pt}{5ex}}
    \label{figure:p}
  \end{minipage}
  \hspace{0.21in}
  \begin{minipage}[b]{2.5in}
    \centering
    \includegraphics[width=2.28in]{D}
    \caption{D is a figure.}
    \label{figure:d}
  \end{minipage}
\end{figure*}

\lipsum[2]

\end{document}

resulting in

enter image description here

Assuming nothing extreme is going on in the caption, you might consider adding \strut to the both caption lines. Of course, that wouldn't help in the extreme case I've demoed here.

Essentially I'm suggesting you make sure the heights and depths of your two captions are equal.