2

I want to combine many eps figures to one eps figures as a table as following.

I want do this with latex/maxtex. I know how to combine eps figures as a single eps, but I want to combine it as a table figure, i.e., add some frames and labels.

enter image description here

Now I almost achieved it. The code is as following:

\begin{table}[htbp]
\label{table-1}
\renewcommand{\arraystretch}{2.0}
\centering
\begin{tabular}{|c |c|c|c|c|}
  \hline \hline
$N=1$ &  \img & \img & \img & \img \\ \hline
$N=1$ &  \img & \img & \img & \img \\ \hline
$N=1$ &  \img & \img & \img & \img \\ \hline
$N=1$ &  \img & \img & \img & \img \\ \hline 
\end{tabular}
\label{table-3}
\end{table}

Now, I care about how to center the label, i.e.,$N=1$? enter image description here

Torbjørn T.
  • 206,688
  • A starting point would be \includegraphics of package graphicx for image inclusion and package xcolor with option table for color stuff and alternating row colors. – Heiko Oberdiek Oct 21 '16 at 17:26
  • See http://tex.stackexchange.com/questions/214707/vertical-center-of-text-in-table-with-images or http://tex.stackexchange.com/questions/19080/how-to-vertically-center-text-with-an-image-in-the-same-row-of-a-table – Torbjørn T. Oct 22 '16 at 06:43
  • Side-remark: adding a label without a caption is not useful in table environments because without a caption handle there is nothing to refer to. Should also give you a log message. Here you are even overwriting the first label{table-1} by the second \label{table-3}. – Matthias Arras Oct 22 '16 at 07:02

2 Answers2

1

Like this?

enter image description here

As Torbjørn T. mentioned, your question is very related (i.e. a duplicate) to this question and/or this question, so I adapted their provided solutions, while adding row colors and removing the unnecessary label:

\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[table]{xcolor}
\usepackage{array}

\begin{document}
    \begin{table}[htbp]
\caption{My composed image}
    \label{table-1}
\centering
    \arrayrulecolor{white}
    \setlength\arrayrulewidth{2pt}
\begin{tabular}{|>{$}c<{$} |c|c|c|c|}
\rowcolor{blue}
  \hline
    &   \textcolor{white}{condition A}
        &   \textcolor{white}{condition B}
            &   \textcolor{white}{condition C}
                &   \textcolor{white}{condition D}                                      \\  \hline
\rowcolor{blue!50}
N=1 &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
        &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
            &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
                &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}  \\ \hline
\rowcolor{blue!25}
N=2 &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
        &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
            &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
                &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}  \\ \hline
\rowcolor{blue!50}
N=3 &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
        &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
            &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}
                &   \includegraphics[width=2cm,margin=0pt 3pt,valign=c]{example-image}  \\
\end{tabular}
    \end{table}
\end{document}
Zarko
  • 296,517
0

The labels on the left can be vertically centered by using column type m, provided by package array. However, it requires a width argument.

An alternative is centering the images, e.g.:

$\vcenter{\hbox{\img}}$
Heiko Oberdiek
  • 271,626