5

3 figures side by side...

I want to put them horizontally, so that you need to rotate the book by 90° to read the figures and captions.

Now, I want to rotate this:

   \begin{figure}[]
\subfigure{
        \includegraphics[width=0.28\textwidth]{figures/a.png}
    }
    \label{sub:graph}
\subfigure{
        \includegraphics[width=0.28\textwidth]{figures/b.png}
    }
    \label{sub:mobile}
\subfigure{
        \includegraphics[width=0.28\textwidth]{figures/c.png}
    }
    \label{sub:dsk}

\caption{Main cap. \ref{sub:graph} sub cap1 \ref{sub:mobile} sub cap2 and \ref{sub:desktop} sub cap3.}
\label{fig:myFig}
   \end{figure}
1
  • Do you mean "vertically"? Do you want the subfigure and figure caption to be rotated? Should the images then be stretched to 0.28\textheight?
    – Werner
    Dec 8 '11 at 17:12
11

Another way is to use the sidewaysfigure environment from the rotating package.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{rotating}
\begin{document}
\begin{sidewaysfigure}
  \centering
  \includegraphics[width=0.28\textheight]{figures/a.png}\quad
  \includegraphics[width=0.28\textheight]{figures/b.png}\quad
  \includegraphics[width=0.28\textheight]{figures/c.png}
  \caption{Caption for the three rotated figures\label{fig:test}}
\end{sidewaysfigure}
\end{document}

This could be combined with subfig to have captions for each figure:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{rotating}
\usepackage{subfig}
\begin{document}
\begin{sidewaysfigure}
  \centering
  \subfloat[First figure]{\includegraphics[width=0.28\textheight]{figures/a.png}\label{fig:a}} \quad
  \subfloat[Second figure]{\includegraphics[width=0.28\textheight]{figures/b.png}\label{fig:b}}\quad
  \subfloat[Third figure]{\includegraphics[width=0.28\textheight]{figures/c.png}\label{fig:c}}
  \caption{Caption for the three rotated figures\label{fig:test}}
\end{sidewaysfigure}
\end{document}

enter image description here

1
5

Here's an option using the hvfloat package:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{hvfloat}

\begin{document}

\hvFloat[%
nonFloat=true,%
capWidth=h,%
capPos=r,%
objectAngle=90,%
capAngle=90,%
objectPos=l%
]{figure}{%
\includegraphics[width=0.28\textheight]{figures/a.png}\quad
\includegraphics[width=0.28\textheight]{figures/b.png}\quad
\includegraphics[width=0.28\textheight]{figures/c.png}
}%
[Rotated Caption]{%
Caption for the three rotated figures}{fig:test}

\end{document}

enter image description here

Another option would be to use \rotatebox from the graphicx package and some minipages; the captions can be obtained with \captionof from the caption package:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\captionsetup[subfigure]{labelformat=parens,subrefformat=parens,labelsep=space}

\begin{document}

\rotatebox{90}{%
  \stepcounter{figure}%
  \begin{minipage}{\textheight}
  \begin{minipage}{.33\textheight}
    \centering
    \includegraphics[width=.9\linewidth]{figures/a.png}
    \captionof{subfigure}[]{First subfigure}%
    \label{sub:graph}
  \end{minipage}%
  \begin{minipage}{.33\textheight}
    \centering
    \includegraphics[width=.9\linewidth]{figures/b.png}
    \captionof{subfigure}[]{Second subfigure}%
    \label{sub:mobile}
  \end{minipage}%
  \begin{minipage}{.33\textheight}
    \centering
    \includegraphics[width=.9\linewidth]{figures/c.png}
    \captionof{subfigure}[]{Third subfigure}%
    \label{sub:desktop}
  \end{minipage}%
  \addtocounter{figure}{-1}%
  \captionof{figure}{Main cap. \ref{sub:graph} sub cap1 \ref{sub:mobile} sub cap2 and \ref{sub:desktop} sub cap3.}
  \end{minipage}%
}

\end{document}

enter image description here

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.