2

I have a table with figures and rotated text in the first two columns. I don't understand 2 issues:

  1. How I can align and especially center the text? With the images I included (all same size and quadratic, scaled such that they fit the page) the text is not centered but bound left (2nd column) and aligned seemingly random (1st column).
  2. How are the gaps between the rows determined? Right now not all are equally wide. If I use a smaller fontsize in the first line's option, the gaps are equal?!

I've tried playing with the options but I'm stuck now, help would be greatly appreciated!

\documentclass[12pt]{article} 
\usepackage{array,multirow}
\usepackage{rotating}

\begin{document}

\begin{table}[H]
        \centering
        \begin{tabular}{ccccc}
              & & \multicolumn{1}{c}{$\nu=-2\%$} & \multicolumn{1}{c}{$\nu=0\%$} & \multicolumn{1}{c}{$\nu=10\%$}\\
                \hline
    \parbox[t]{\multirow{2}{*}{\rotatebox[origin=c]{90}{Case A}}} & \rotatebox[origin=left]{90}{Value} &
            \includegraphics{Tux.png} & \includegraphics{test.png} & \includegraphics{test.png} \\
& \rotatebox[origin=left]{90}{Value change}  & \includegraphics{test.png} & \includegraphics{test.png} & \includegraphics{test.png} \\
    \parbox[t]{\multirow{2}{*}{\rotatebox[origin=c]{90}{Case B XYZ}}} & \rotatebox[origin=left]{90}{Value} & \includegraphics{test.png} & \includegraphics{test.png} & \includegraphics{test.png} \\
& \rotatebox[origin=left]{90}{Value change}  & \includegraphics{test.png} & \includegraphics{test.png} & \includegraphics{test.png}
            \end{tabular}
            \caption{Value }
        \label{tab:num12}
\end{table}
\end{document}
  • 1
    Your test file generates the error ! Missing number, treated as zero. <to be read again> \relax l.12 ...2}{*}{\rotatebox[origin=c]{90}{Case A}}} & please fix – David Carlisle Jul 23 '14 at 11:52
  • 1
    The error is \parbox[t]{\multirow but hard to guess what you intended \multirow can not be in a \parbox and a \parbox needs a width argument. – David Carlisle Jul 23 '14 at 11:55
1

Here is some code that may be useful.

\documentclass[12pt]{article}
\usepackage{array,multirow}
\usepackage{rotating}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\begin{document}

\begin{table}[H]
        \centering
        \begin{tabular}{cc*{3}{C{0.25\textwidth}}}
              & & \multicolumn{1}{c}{$\nu=-2\%$} & \multicolumn{1}{c}{$\nu=0\%$} & \multicolumn{1}{c}{$\nu=10\%$}\\
                \hline
    \multirow{2}{*}{\rotatebox[origin=c]{90}{\parbox[t]{3cm}{\centering Case A}}} & \rotatebox[origin=c]{90}{\parbox[t]{1cm}{Value}} &
            \includegraphics[width=1cm]{Tux.png} & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png} \\
& \rotatebox[origin=c]{90}{\parbox[t]{3cm}{\centering Value change}}  & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png} \\
    \multirow{2}{*}{\rotatebox[origin=c]{90}{\parbox[t]{3cm}{\centering Case B XYZ}}} & \rotatebox[origin=c]{90}{\parbox[t]{1cm}{Value}} & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png} \\
& \rotatebox[origin=c]{90}{\parbox[t]{3cm}{\centering Value change}}  & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png} & \includegraphics[width=3cm]{test.png}
            \end{tabular}
            \caption{Value }
        \label{tab:num12}
\end{table}
\end{document}

enter image description here

You have to adjust the width of each \parbox, adjust the width of image in \includegraphics and in the column C{0.25\textwidth} to suit your needs.

  • Thanks so much! What do you think about realizing the same with a minipage? like \begin{rotate}{90}\begin{minipage}{2.8in}\begin{center}Case A\end{center}\end{minipage}\end{rotate} – Robert Aug 27 '14 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.