1

My question is similar to this one: How to rotate text in multirow table? but my table is composed of individual .eps files (which are all the same size, created in a different program) via \includegraphics. I want to rotate the text in column one of the table to serve as an overall y-axis label. However, I can't figure out how to align it properly.

My output currently has the desired y-axis label too low, ending about at the middle rather than centered vertically. I can adjust the placement manually using the fixup parameter described at the bottom here: Placing a figure inside a multirow table cell but it would be great if I could do this programmatically.

In case it matters, my actual table consists of 8 panels in two rows and four columns (plus an additional column/row for the overall axis labels).
Any suggestions?

\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\newcommand{\scale}{0.8}
\begin{table}
\centering
\setlength{\tabcolsep}{0.2\tabcolsep}

\begin{tabular}{c@{}cc}
\parbox[t]{0.25in}{\multirow{2}{*}[0.8in]{\rotatebox[origin=c]{90}{\Large dM/dlnD$_p$ ($\mu$g m$^{-3}$)}}} & 
  \includegraphics[scale=\scale]{image1} &
  \includegraphics[scale=\scale]{image2}\\
& \includegraphics[scale=\scale]{image3} &
  \includegraphics[scale=\scale]{image4}\\
  \multicolumn{3}{c}{\Large Aerodynamic diameter ($\mu$m)}\\
\end{tabular}
\end{table} 

\end{document}
  • 1
    I'm really unclear what you're asking for. You are already using \rotatebox, which would be my recommendation. So, how is this not achieving the effect you want? – A.Ellett Jan 10 '15 at 21:28
  • The text within \rotatebox is not centered in the overall 2x2 table of figures. At least, not without manual adjustment via the fixup parameter. – Chris Nolte Jan 10 '15 at 23:02
  • Since I don't have access to your images, I replaced them with images from the mwe package, and it looked fine. Perhaps you images are assymetrical. – John Kormylo Jan 11 '15 at 0:45
  • I did not know about the existence of the mwe package. Here is a new example. – Chris Nolte Jan 11 '15 at 12:51
  • Thanks @John. In this line: \parbox[t]{0.25in}{\multirow{2}{*}[0.8in]{\rotatebox[origin=c]{90}{\Large dM/dlnD$_p$ ($\mu$g m$^{-3}$)}}} & the [0.8in] is a fixup parameter, adjusted by trial and error. Take it out and you'll see the misalignment I am talking about. – Chris Nolte Jan 11 '15 at 13:00
0

You still need a fixup, but you can compute it rather than use trial and error.

\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{mwe}

\newlength{\tempdima}
\newlength{\tempdimb}

\begin{document}
\newcommand{\scale}{0.5}

% get size of multicol
\settoheight{\tempdima}{\begin{tabular}[b]{cc}
  \includegraphics[scale=\scale]{example-image-a} &
  \includegraphics[scale=\scale]{example-image-b}\\
  \includegraphics[scale=\scale]{example-image-c} &
  \includegraphics[scale=\scale]{example-image}
\end{tabular}}
%subtract width of text
\settowidth{\tempdimb}{\Large dM/dlnD$_p$ ($\mu$g m$^{-3}$)}
\addtolength{\tempdima}{-\tempdimb}

\centering
\setlength{\tabcolsep}{0.2\tabcolsep}
\begin{tabular}{p{0.25in}@{}cc}
 \multirow{2}{*}[0.5\tempdima]{\rotatebox[origin=c]{90}{\Large dM/dlnD$_p$ ($\mu$g m$^{-3}$)}} & 
  \includegraphics[scale=\scale]{example-image-a} &
  \includegraphics[scale=\scale]{example-image-b}\\
& \includegraphics[scale=\scale]{example-image-c} &
  \includegraphics[scale=\scale]{example-image}\\
  \multicolumn{3}{c}{\Large Aerodynamic diameter ($\mu$m)}
\end{tabular}

\end{document}

table

  • The original calculation looked good, but was in fact incorrect. Basically one needs to use the height a bottom aligned tabular (or add the depth), subtract the width of the text, then divide by two. – John Kormylo Jan 13 '15 at 15:12

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.