There are two ways I would like to describe the figures in the table: put sub caption under each figure (preferred) or insert the description directly in the figure.
To create a table of figures, I wrote the following code:
\begin{sidewaystable}[!htbp]
\label{tab:gr}
\centering\small\setlength\tabcolsep{2pt}
\begin{tabularx}{\textwidth}{@{}>{\bfseries}c*{9}{X}@{}}
\includegraphics[width=2.2in,height=1.8in]{A1}&
\includegraphics[width=2.2in,height=1.8in]{A2} &
\includegraphics[width=2.2in,height=1.8in]{A3} &
\includegraphics[width=2.2in,height=1.8in]{A4} \\
\includegraphics[width=2.2in,height=1.8in]{B1} &
\includegraphics[width=2.2in,height=1.8in]{B2} &
\includegraphics[width=2.2in,height=1.8in]{B3} &
\includegraphics[width=2.2in,height=1.8in]{B4} \\
\includegraphics[width=2.2in,height=1.8in]{fig/C1} &
\includegraphics[width=2.2in,height=1.8in]{fig/C2} &
\includegraphics[width=2.2in,height=1.8in]{fig/C3} &
\includegraphics[width=2.2in,height=1.8in]{fig/C4} \\
\includegraphics[width=2.2in,height=1.8in]{fig/D1} &
\includegraphics[width=2.2in,height=1.8in]{fig/D2} &
\includegraphics[width=2.2in,height=1.8in]{fig/D3} &
\includegraphics[width=2.2in,height=1.8in]{fig/D4} \\
\end{tabularx}
\caption{The main caption of the table.}
\end{sidewaystable}
Because I got different meanings of figures given a row, I want to put individual description under (right to, in this case) each figure.
Best Answer
You can use the
\subcaption
command from the package with the same name to add a caption for each sufigure.There is a problem with using subcaptions inside a
tabularx
, see this bug report at SourceForge, so it's better to use a regulartabular
withp
columns.Notes about the code:
\label
always has to be placed after (or within) the\caption
.A space between the image and the subcaption seems to introduce extra vertical spacing. I.e., instead of
write
To further compress the table vertically, you can add
\renewcommand\arraystretch{0}
right before thetabular
. You can also move the subcaption closer to the images with\captionsetup[subtable]{aboveskip=2pt}
. These are in the code, but commented.