# Special arrangements of subfigures

I need to arrange my pictures on the way shown in the attached figure. Please any help from you.

-
Could you be a bit more precise, please. It is unclear if you also need the labels on the top and on the left. – Stefan Pinnow Feb 15 at 20:25
Hi Stefan Pinnow, In fact I have 9 pictures arranged in a 3 columns and 3 rows. Each column contains the evolution in time of the simulation picture on focus. for exemple column 1, we have the evolution of N agents from time t=0 to time t=200. The same as for the other columns. So, I want it exactly like I clarified it on the picture. – khaldi Feb 15 at 20:38
Hi Stefan, Yes I need the labels both on the top and on the left. But the top labels are for columns and the left labels are for rows. There is no label for each picture. I need a one caption for the entire arrangement. – khaldi Feb 15 at 20:44
It may be a duplicate, but surely not of the linked question. – egreg Feb 15 at 21:06

This can be achieved for example with the tikz package and the matrix library. Here is a dummy picture showing a similar thing as in your question with the corresponding result.

% works with tikz v3.0.1a
\documentclass[border=2mm]{standalone}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{
matrix,
}
% define size of rectangular pictures
\pgfmathsetlengthmacro{\Size}{25mm}
\begin{document}
%\begin{figure}
\begin{tikzpicture}[
Pic/.style={
minimum size=\Size,
inner sep=0pt,
% this is just to show something
% comment the two following lines or adjust them accordingly
draw=black!50,
fill=black!25,
},
]
\matrix [
% typeset nodes in math mode
matrix of math nodes,
% use a smaller font for the nodes
node font=\scriptsize,
% rotate all nodes in the first column
column 1/.append style={
every node/.append style={
rotate=90,
},
},
% set the separations of the columns and rows
row sep=2.5mm,
column sep=2.5mm,
] {
&[-2ex] N = 150 & N = 200 & N = 250 \\[-2ex]
t = 0   & \node [Pic] {};
& \node [Pic] {};
& \node [Pic] {}; \\
t = 100 & \node [Pic] {};
& \node [Pic] {};
& \node [Pic] {}; \\
t = 200 & \node [Pic] {};
& \node [Pic] {};
& \node [Pic] {}; \\
};
\end{tikzpicture}
%    \caption{Just a dummy caption}
%        \label{fig:dummy}
%\end{figure}
\end{document}


Now you simply have to replace the \node [Pic] {};s with node [Pic] {\includegraphics[width=\Size]{<pic name>}}; where <pic name> is the corresponding picture name which can be found by the graphicx package. Hopefully my comments in the code are sufficient that you can modify sizes and distances on your own.

Please note that the standalone documentclass does not provide a figure environment, why I have commented these lines of code.

-
thanks very much for your helps, the both solutions have been successfully given me what I am willing to do. This gained me much time. – khaldi Feb 16 at 19:16
@khaldi, you are welcome. Two more small comments: I would also add a unit to time, so that it is clear if 200 is in seconds, minutes or years. If you don't know the siunitx package yet, give it a try and state it, e.g. as \SI{200}{\second}. Please accept one of the solutions as an answer, so it is clear that a solution is given that fits your needs. Should there be any new solution in the future that will be better than the already chosen one you are free to change the accepted answer at any time. – Stefan Pinnow Feb 16 at 19:22
Oh Stefan, that is also a great improvement. thanks for your interest. I am so sorry for replying late to your comment. – khaldi Feb 27 at 13:17
@khaldi, not a problem; better late than never ;) – Stefan Pinnow Feb 27 at 14:09
Hi Stefan, I would ask you about how to precise both width and height and not the size in the line \pgfmathsetlengthmacro{\Size}{25mm}. because I noticed that this gives me a square container in witch the pictures will be included. – khaldi Feb 29 at 14:44

See, if this is what you looking for:

\documentclass{article}
\usepackage{array,graphicx}

\begin{document}
\begin{tabular}{c*{3}{>{\centering\arraybackslash}p{0.3\textwidth}}}
&   $N=150$ &   $N=150$ &   $N=250$                             \\
\rotatebox{90}{\qquad$t=0$}
&   \includegraphics[width=\linewidth]{example-image-a}
&   \includegraphics[width=\linewidth]{example-image-b}
&   \includegraphics[width=\linewidth]{example-image-c}   \\
\rotatebox{90}{\qquad$t=100$}
&   \includegraphics[width=\linewidth]{example-image-a}
&   \includegraphics[width=\linewidth]{example-image-b}
&   \includegraphics[width=\linewidth]{example-image-c}   \\
\rotatebox{90}{\qquad$t=200$}
&   \includegraphics[width=\linewidth]{example-image-a}
&   \includegraphics[width=\linewidth]{example-image-b}
&   \includegraphics[width=\linewidth]{example-image-c}   \\
\end{tabular}
\end{document}


-
thanks very much for your reply, this saved my time. thanks in advance. Both solutions have been tested and the both have given me what I am seeking to reach. – khaldi Feb 16 at 19:18