# How to get sidewaysfigure to stay on specific page

I have a rather large figure which I want to put in the appendix. Further, I want this figure to appear sideways (landscape mode). I have been trying with the following code which gives me exactly what I want except the image keeps showing up on the next page and not on the page which has the appendix section title and which is the page I want it to appear on. This means that now I have the appendix title on an otherwise empty page followed by the figure on the next page. If I use figure instead of sidewaysfigure it works just fine although I want the image in landscape mode and not in portrait mode.

I have tried to change \begin{sidewaysfigure}[htbp] to \begin{sidewaysfigure}[h!] and \begin{sidewaysfigure}[H] etc. without any luck. I have also tried reducing the size of the figure but even though it reduces in size it does not move up on the previous page. It seem to me the issue is with begin{sidewaysfigure} but I might be completly wrong.

Any help is much appreciated!

\documentclass[a4paper, 12pt, hidelinks]{article}
\usepackage{fancyhdr}
\usepackage[pdftex]{graphicx}
\usepackage{rotating}

\begin{document}
\newpage
\appendix
\section{Impulse Responses}
\begin{sidewaysfigure}[htbp]
\centering
\begin{minipage}{0.92\linewidth}
\includegraphics[width=\linewidth,keepaspectratio]{test1.pdf}
\caption{Impulse Responses}
\vspace{0.2cm}
\emph{\footnotesize Note:} {\footnotesize The impulse responses.}
\end{minipage}
\label{fig:xx}
\end{sidewaysfigure}

\end{document}


Use a simple sideways environment and \captionof{figure}:

\documentclass[a4paper, 12pt, hidelinks]{article}
\usepackage{fancyhdr}
\usepackage[pdftex, demo]{graphicx}
\usepackage{rotating, float, caption}

\begin{document}
\newpage
\appendix

\section{Impulse Responses}
\mbox{} \begin{center}
\begin{sideways}%[htbp]
\begin{minipage}{0.92\linewidth}
\includegraphics[width=\linewidth,keepaspectratio]{test1.pdf}
\captionof{figure}{Impulse Responses}
\vspace{0.2cm}
\emph{\footnotesize Note:} {\footnotesize The impulse responses.}
\label{fig:xx}
\end{minipage}
\end{sideways}
\end{center}

\end{document}
`

• It works! Thank you Bernard! Do you know why my previous attempt did not work? How come the figure would not move up on the previous page even though it would have fit size wise? Jul 31, 2016 at 17:34
• It seems sideways floats require a page of their own, but I really don't know what in the code induces this behaviour. Jul 31, 2016 at 17:53
• Okay. Thank you for both answers! This really helped me. Jul 31, 2016 at 18:17
• @Bernard How would you do it with two subfigures?
– Hel
Dec 17, 2017 at 21:14