[Tex/LaTex] get the page horizontal and put 3×3 images

horizontal alignmentsubfloatszwpagelayout

First, I used following:

\usepackage{rotating}
\usepackage{subfigure}
....
\begin{sidewaysfigure}
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot1a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot1b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot1c.png}}
\caption{Title for both}
\end{sidewaysfigure}

\begin{sidewaysfigure}
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot2a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot2b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot2c.png}}
\caption{Title for both}
\end{sidewaysfigure}

\begin{sidewaysfigure}
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot3a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot3b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot3c.png}}
\caption{Title for both}
\end{sidewaysfigure}

The above code creates three different pages, however I want them like a 3 x 3 matrix with horizontal page. How can I do that?

What I want!

Best Answer

If you put everything inside a single sidewaysfigure environment, i.e.

\begin{sidewaysfigure}
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot1a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot1b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot1c.png}}
\caption{Title for all}
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot2a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot2b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot2c.png}}
\caption{Title for all}
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot3a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot3b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot3c.png}}
\caption{Title for all}
\end{sidewaysfigure}

it will work. Another possible solution involves the pdflscape package (using this package has the advantage that the page is rotated in the pdf viewer, so you don't have to rotate your neck). The code is presented below. The caption package is used only to adjust the space between the figures and the caption, through \captionsetup (you could use this as well if you decide to stick to sidewaysfigure). If the figure is inside a document, it may prove useful to use afterpage (remove % from the commented lines)

\documentclass[demo]{article}
\usepackage[top=2cm,bottom=2cm]{geometry}
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{subfigure}
\usepackage{caption}
\captionsetup{aboveskip=0pt}
%\usepackage{afterpage}
\begin{document}
%\afterpage{
\begin{landscape}
\begin{figure}
\centering
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot1a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot1b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot1c.png}}
\caption{Title for all}
\vskip3ex
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot2a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot2b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot2c.png}}
\caption{Title for all}
\vskip3ex
\subfigure[Title A]{\includegraphics[width=7cm]{figures/plot3a.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot3b.png}}
\subfigure[Title B]{\includegraphics[width=7cm]{figures/plot3c.png}}
\caption{Title for all}
\end{figure}
\end{landscape}
%}
\end{document}

enter image description here