# Alignment of horizontal subfigures

I have three images as subfigures. Two images are aligned happily, the first one doesn't line up. All images are the same size (519x346 pixels).

This is what it looks like:

I'd like to line up (a) (both image and caption) if possible, the way that (b) and (c) are.
This is the code to produce the currently-seen image:

\documentclass[11pt]{report}
\usepackage[pdftex, demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}
\begin{figure}[htbp]
\centering
\begin{subfigure}[h]{0.3\textwidth}
\includegraphics[width=\textwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Side_s}
\label{rfidtest_xaxis}
\caption{Testing of the X-axis.}
\end{subfigure}
\begin{subfigure}[h]{0.3\textwidth}
\includegraphics[width=\textwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Vertical_s}
\caption{Testing of the Y-axis.}
\label{rfidtest_yaxis}
\end{subfigure}
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Other_s}
\caption{Testing of the Z-axis.}
\label{rfidtest_zaxis}
\end{subfigure}
\caption[RFID tag read-range testing]{RFID tag read-range testing setup. In all tests, the finger moves towards along an axis towards the tag.}
\label{rfidtag_testing}
\end{figure}
\end{document}

-
The [h] option is unknown and ignored; you should use [b] –  egreg Dec 21 '12 at 12:09
Just a remark: it shouldn't be necessary to give the graphicx package a pdftex oprtion –  Benedikt Bauer Dec 21 '12 at 12:10

First, the optional argument to the subfigure environment is the same as for minipage, so t(op), c(enter) or b(ottom), if I remember correctly, and this specifies the "anchor" I think, of the subfigure. Hence, h doesn't do anything.

Second, in the first subfigure you've placed the label before the caption, which creates the extra space between them (exactly why this happens, I'm not sure). The label should always be after or within the caption anyways, to get correct cross references.

\documentclass[11pt]{report}
\usepackage[pdftex, demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Side_s}
\caption{Testing of the X-axis.}
\label{rfidtest_xaxis}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Vertical_s}
\caption{Testing of the Y-axis.}
\label{rfidtest_yaxis}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\textwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Other_s}
\caption{Testing of the Z-axis.}
\label{rfidtest_zaxis}
\end{subfigure}
\caption[RFID tag read-range testing]{RFID tag read-range testing setup. In all tests, the finger moves towards along an axis towards the tag.}
\label{rfidtag_testing}
\end{figure}
\end{document}

-