# figure array with top and side captions

I want to have a 3x3 figure array in which parameters change horizontally and vertically..

so i want to end up with captions on the left hand side of the figure array and on the top of it:

    cap a cap b cap c


cap d Fig A Fig B Fig C

cap e Fig D Fig E Fig F

cap f Fig G Fig H Fig I

any ideas on how to achieve this?

• The word "caption" carries an inference that it is associated with an item, as in 3a, 3b, 3c for three subfigures. In your case, 6 "captions" for 9 figures would seem to indicate otherwise. Thus, will these "captions" be text but without a reference-able identifier (i.e., for Fig 3, they won't be a-f AND, there will be no \ref{fig3:subfiga} type calls) elsewhere in the document? – Steven B. Segletes Dec 28 '14 at 16:58
• yes, there will be no need to reference calls to the subfigures..the figure will be referenced as the whole array, I jut thought it might help the clarity to indicate those "captions" on the top and side, rather than describing the layout in a global caption at the bottom – vass Dec 28 '14 at 17:04
• Perhaps just sticking the whole thing in a 4x4 tabular would suffice. Do you understand what I am suggesting? – Steven B. Segletes Dec 28 '14 at 17:22

The OP had indicated that these top/side captions were merely text, not associated with a single subfigure, and that the individual subfigures would not be separately referenced. Thus, a tabular should suffice for this need.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{stackengine}
\raisebox{-.5\height}{\includegraphics[#1]{#2}}}}
\begin{document}
\begin{figure}[p]
\begin{tabular}{p{.2\textwidth}p{.2\textwidth}p{.2\textwidth}p{.2\textwidth}}
& Column 1 & Column 2 & Column 3 caption which can go on to some length\\
Row 1 caption which can go on for some length
&\IncG[width=.2\textwidth,height=.2\textwidth]{file11}
&\IncG[width=.2\textwidth,height=.2\textwidth]{file12}
&\IncG[width=.2\textwidth,height=.2\textwidth]{file13}\\
Row 2 caption
&\IncG[width=.2\textwidth,height=.2\textwidth]{file21}
&\IncG[width=.2\textwidth,height=.2\textwidth]{file22}
&\IncG[width=.2\textwidth,height=.2\textwidth]{file23}\\
Row 3 caption
&\IncG[width=.2\textwidth,height=.2\textwidth]{file31}
&\IncG[width=.2\textwidth,height=.2\textwidth]{file32}
&\IncG[width=.2\textwidth,height=.2\textwidth]{file33}\\
\end{tabular}
\caption{this is the main figure caption}
\end{figure}
\end{document}


If you want the row captions to begin higher up on the figures, so that you have more room for row-caption text, then this altered definition for including the figures would help:

\newcommand\IncG[2][]{\addstackgap{%
\raisebox{\dimexpr-\height+\baselineskip\relax}{\includegraphics[#1]{#2}}}}

• perfect, that did the trick! – vass Dec 28 '14 at 20:27