[Tex/LaTex] Rotate image in LaTeX

graphicsrotatingwide-image

I would like to rotate an image (in LATEX) keeping it at the same location (I just want to rotate it) In order to do that I used \begin{sidewaysfigure}[H] but is not working.

The current output: The image appears on the last sheets

what's going on? any idea? I also changed the height/widht but it doesn't work either:

\begin{sidewaysfigure}[H]
 \includegraphics{image}
 \caption{Swimlane Diagram.}
%\label{swim}
\end{sidewaysfigure}

Best Answer

You can save the figure + caption in a box and then rotate the box, or use the sidewaysfigure environment from the rotating package. It puts the figure on its own page. For a small figure you can use the \rotcaption command to rotate the caption.

enter image description here

enter image description here

\documentclass{memoir}
\usepackage{caption}
    \captionsetup{font=small,labelfont=bf}
\usepackage{graphicx}
\usepackage{rotating}

\newsavebox{\savefig}
\begin{document}

Save the figure + caption in a box and rotate
\begin{figure}[htbp]
    \centering
    \savebox{\savefig}{\rule{8cm}{5cm}}
    \rotatebox{90}{%
        \begin{minipage}{\wd\savefig}
            \usebox{\savefig}
            \caption{Swimlane Diagram}
        \end{minipage}}
\end{figure}

Just rotate the caption
\begin{figure}[htbp]
    \hfill
    \rule{5cm}{8cm}%
    \hspace{\abovecaptionskip}%
    \begin{minipage}[b][8cm][c]{2\baselineskip}
        \rotcaption{Just rotate caption}
    \end{minipage}
    \hfill\mbox{}
\end{figure}

Use the sidewaysfigure environment
\begin{sidewaysfigure}
    \centering
    \rule{15cm}{10cm}
    \caption{A sideways figure}
\end{sidewaysfigure}

\end{document}**

Taken from --https://tex.stackexchange.com/a/46337/197451

Related Question