Feed on
Posts
Comments

to tile images in a figure, use the following code:

\begin{figure}[h]
\begin{center}$
\begin{array}{cc}
\includegraphics[width=2.5in]{image1.jpg} &
\includegraphics[width=2.5in]{image2.jpg}
\end{array}$
\end{center}
\caption{my caption}
\end{figure}

to place more than 2 images on a line, add extra ‘c’s to the {array} specification and follow each \includegraphics[]{} with an ampersand (&). to create a matrix of images, insert newlines using two slashes: for instance, to make a 2X2 matrix of images:

\begin{figure}[h]
\begin{center}$
\begin{array}{cc}
\includegraphics[width=2.5in]{image1.jpg} &
\includegraphics[width=2.5in]{image2.jpg} \\ \includegraphics[width=2.5in]{image1.jpg} &
\includegraphics[width=2.5in]{image2.jpg}
\end{array}$
\end{center}
\caption{my caption}
\end{figure}

Stumble it!

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

13 Responses to “place multiple images on one line in latex (or even create a matrix of images)”

  1. on 10 Jul 2006 at 1:58 pm Anonymous

    Hey man, good website with very useful information on latex.

    Good luck with your PhD in MIT.

    Bidur Khanal
    Research student
    University if southampton, UK

  2. on 29 Jul 2006 at 5:01 pm Anonymous

    Hello Man,

    Thanks for the nice code.

    All the best.
    Charles

  3. on 09 Aug 2006 at 9:33 am Anonymous

    You mention it in the main text of your message, but it is not in the code - that you need two slashes (\), code only has one

    Works great then.

  4. on 13 Aug 2006 at 9:12 pm Lawrence David

    thanks for catching that - i’ve updated the code!

  5. on 03 Dec 2006 at 5:46 pm Max

    Why don’t you use the tabular environment? It works just like array, but it doesn’t need to be in math mode (i.e. no surrounding dollars).

    Also, try the subfig package: http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=subfig

  6. on 23 Jul 2007 at 12:29 pm zoltan

    its 30°C in my office. i finish this report or it finishes me. thanx for the code.

  7. on 30 Dec 2007 at 5:06 am Tolga

    Great one thank you. It really eased my pain.

    I wonder if there is some code for placing images like:

    [image]
    [image] [image]

    I could not make this by playing with your code.

  8. on 30 Dec 2007 at 5:26 am Tolga

    Reply to myself for three images: one centered on top, the two below, again centered:

    \begin{figure}[H]
    \begin{center}
    \subfloat{\includegraphics[width=2cm]{image1.png}} \\
    \subfloat{\includegraphics[width=2cm]{image2.png}}
    \subfloat{\includegraphics[width=2cm]{image3.png}}
    \end{center}
    \end{figure}

  9. on 06 Jan 2008 at 11:57 am Lawrence David

    thanks tolga, i didn’t know that!

  10. on 30 Mar 2008 at 1:01 pm evenfall

    How a bout this ?

    [image] [ one ]
    big
    [image] [ image ]

    couldn’t do it at all

  11. on 24 Apr 2008 at 4:14 pm Kate

    Thanks Lawrence and the other commenters. This is a great tip.

  12. on 02 Jul 2008 at 10:16 pm Jianzhou Li

    Hello sir,
    Do you know how to put two figures top-down tightly, without any space between them. I tried several different method. The array method mention here
    get the large space between the two figures.

    Many thanks!

    \begin{figure}[h]
    \begin{center}$
    \begin{array}{c}
    \includegraphics[width=2.5in]{64_1_2.eps} \\
    \includegraphics[width=2.5in]{64_1_2.eps}
    \end{array}$
    \end{center}
    \caption{my caption}
    \end{figure}

  13. on 25 Aug 2008 at 8:07 am Stephen

    Great tip! I’ve always wanted to know how to combine multiple images into one figure - no more minipage then :)

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.