Matrix/Grid of Images

3,053 views
Skip to first unread message

laagveen

unread,
May 16, 2007, 11:13:56 AM5/16/07
to LaTeX Users Group
Hi All,

I trying to make a grid of pictures of 2(r) by 3(c) images and only a
caption for each column. I tried using the subfigure package but I do
not get it to behave the way I want it. Does anybody know another way?

Bruno Lopes Vieira

unread,
May 16, 2007, 2:51:29 PM5/16/07
to latex...@googlegroups.com
What's the way do you want?
What's the matter with subfigure???


2007/5/16, laagveen <laag...@gmail.com>:
Bruno Lopes Vieira

Linux User #324250
Tel: +55 (82) 8815-9704
--
"A primeira regra é: é preciso ter competência aliada à sorte. A segunda; manter-se resoluto e não desistir até que surja uma idéia feliz."

(D. Poia, matemático)

Werner

unread,
May 16, 2007, 5:01:40 PM5/16/07
to LaTeX Users Group
Supply a minimal example of your current 'troubling' LaTeX code...

If you use subfigure (or subfig for that matter), you should be able
to actually just have 3 subfigures, depicting the 3 columns in your
figure environment, and then stack 2 images/pictures on top of one
another using a regular tabular environment with a single column. More
specifically,

\documentclass{article}
\usepackage{graphicx,subfig}

\begin{document}

\begin{figure}[ht]
\subfloat[Column 1 subcaption]{%
\begin{tabular}{c}
\includegraphics[...]{pic1} \\
\includegraphics[...]{pic2}
\end{tabular}
}%
\subfloat[Column 2 subcaption]{%
\begin{tabular}{c}
\includegraphics[...]{pic3} \\
\includegraphics[...]{pic4}
\end{tabular}
}%
\subfloat[Column 3 subcaption]{%
\begin{tabular}{c}
\includegraphics[...]{pic5} \\
\includegraphics[...]{pic6}
\end{tabular}
}%
\caption[...]{6 pictures in 1 figure environment}
\label{fig:lots-of-figures}
\end{figure}

\end{document}

I haven't tested the example code above.

Werner

laagveen

unread,
May 21, 2007, 5:46:24 AM5/21/07
to LaTeX Users Group
Thank you for your replies! I used the solution from Werner, but I
used a subfigure instead of a subfloat and added
\setlength{\tabcolsep}{0mm} for equal spacing between the rows and
collumns.

Arco.

\begin{figure}\label{fig:label}
\begin{center}
\setlength{\tabcolsep}{0mm}
\subfigure[]{%
\begin{tabular}{c}
\includegraphics*[width=0.25\textwidth]{image1}\\
\includegraphics*[width=0.25\textwidth]{image2}
\end{tabular}
}%
\subfigure[]{%
\begin{tabular}{c}
\includegraphics*[width=0.25\textwidth]{image3}\\
\includegraphics*[width=0.25\textwidth]{image4}
\end{tabular}
}%
\subfigure[]{%
\begin{tabular}{c}
\includegraphics*[width=0.25\textwidth]{image5}\\
\includegraphics*[width=0.25\textwidth]{image6}
\end{tabular}
}%
\caption{a caption}
\end{center}
\end{figure}

Reply all
Reply to author
Forward
0 new messages