# Figure placed on a separate page is centered and not on top

I have multiple figures placed in my document (all of which are using [htbp], [ht] etc. and are placed correctly). The last figure receives a separate page (which is alright) but it's centered on this page, which looks weird as the figure is quite small.

Is there any way to get this figure on top of this page? As written above, its a separate page and the last one in this chapter.

I can't really provide a minimal example (since I guess that the position depends on my previous figures), but here's the code I use for the figure (I've tried [ht], [ht!], [htbp] etc but none of them work - I've also deleted the .aux files before compiling):

\begin{figure}[t!]
\centering
\begin{tabularx}{\columnwidth}{cc}
\subfloat[Results 1]
{ \centering    \includegraphics[width=0.47\textwidth,height=0.47\textheight,keepaspectratio]{images/plot1}
}
&
\subfloat[Results 2]
{ \centering    \includegraphics[width=0.47\textwidth,height=0.47\textheight,keepaspectratio]{images/plot2}
}
\end{tabularx}
\caption{Blabla}
\end{figure}


• Hi and welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. It is the default and in general correct behaviour that floats on pages with no text are vertically centered. Why would you want it another way?
– yo'
May 26, 2014 at 10:33
• It looks a bit weird because the image is quite small. Of course, another option would be to make it bigger (it's a plot), but I'm just wondering if there's a way to place it on top. May 26, 2014 at 10:47
• The usage of ! as a specifier to the figure environment is discouraged for years now ;-)
– user31729
May 26, 2014 at 10:51
• Why are you using [!t] in the first place? How about [!ht] instead if there is room for it here. May 26, 2014 at 11:02
• You could drop the figure environment and use \captionof{figure}{Blabla} instead. Then the graphicx is at the place where you want to have it, if there is enough place left on the page, otherwise on the next page.
– user31729
May 26, 2014 at 11:04

Just place a large enough \vspace after the caption to push it to the top. Specifying the \vspace too large is OK. Here, I place a figure on a [p] page to guarantee the "bad" behavior, but add a 128inch \vspace after the caption, exaggerated to make the point that the actual length is immaterial, if it is large enough to do the trick.

\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}[p]
\centering
\includegraphics[width=0.47\textwidth,height=0.47\textheight]{file}
\caption{Blabla}
\vspace{128in}
\end{figure}
\end{document}


To avoid the "warning" that comes from a too-large float (if that bothers you), one could add negative \vspace prior to the figure contents, as in

\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}[p]
\vspace{-128in}
\centering
\includegraphics[width=0.47\textwidth,height=0.47\textheight]{file}
\caption{Blabla}
\end{figure}
\end{document}

• That's a nasty thing to do that generates a Float to large! warning.
– yo'
May 26, 2014 at 11:56
• @tohecz How does the children's rhyme go?... Sticks and stones can break my bones, but warnings can never hurt me. May 26, 2014 at 11:58
• @tohecz Please see my follow up May 26, 2014 at 12:01
• Warning should make you warned. Warning appearing for things that are correct should be avoided. I always come through the log to check for presence of warning. And these "ok" ones then only confuse me.
– yo'
May 26, 2014 at 12:08
• @tohecz I didn't mean to diminish the import of your statement. You admittedly make a good point, which spurred me to revise my answer. May 26, 2014 at 12:10

As tohecz pointed out, this is the general and correct behavior. But you can change this by using

\makeatletter
\setlength{\@fptop}{0pt}
\makeatother


as found here, following the answer to a similar question.

• Setting lengths globally is not always a good idea ;-)
– user31729
May 26, 2014 at 11:00
• If you deviate from the default, at least do it consistently ;-) @ChristianHupfer May 26, 2014 at 11:32
• @ChristianHupfer I agree with Markus on this. The solution is IMHO the proper way to do it, if you want it in the first place. Upvoted.
– yo'
May 26, 2014 at 11:57
• Thanks a lot! It might sound weird but I like the idea of the centering, it's just the very last page of the paper and looks extremely weird (since a small image is in the middle). May 26, 2014 at 20:14