1

I include a .tikz figure in my document using the following lines:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage{pgfplots}
\pgfplotsset{compat=1.9}

\usetikzlibrary{plotmarks}


\begin{document}


\newpage
\null
\begin{figure}[h]
\centering
\input{pic/evaluation1}
\caption{Evaluation 1.}
\label{evaluation1}
\end{figure}
\begin{figure}[h]
\centering
\input{pic/evaluation2}
\caption{Evaluation 2.}
\label{evaluation 2}
\end{figure}
\begin{figure}[h]
\centering
\input{pic/evaluation3}
\caption{Evaluation 3.}
\label{evaluation3}
\end{figure}

\end{document}

I want the first two figures to be located on one page and the third figure to be located on the top of the next page. This LaTeX code, however, lets the first figure be on top of the page and the other two figures on the next page.

3
  • 1
    Maybe the picture is too big?
    – Johannes_B
    Mar 5, 2017 at 8:59
  • 1
    Because there is nothing else on the page, the page becomes a float page, and as such see tex.stackexchange.com/questions/28556/… Add some text, or \null before the figure to see it move to the top of the page. Mar 5, 2017 at 9:11
  • Thx Torbjorn! I have tried your comment, and it does work - somehow. But I have added some more information to my question, I didn't know I would need that in the beginning.
    – user123551
    Mar 5, 2017 at 9:23

1 Answer 1

2

I would like to suggest that you placed the first two graphs in a single figure environment, and that you state [p] as the placement specifier. That way, the graphs will be placed together on a page. For the remaining figure environment, change the placement specifier from [h] to [t!] to assure that it'll be placed at the top of the page that follows the page with the first two graphs.

The modified code would thus look like this -- observe that I can't post a meaningful screenshot, as I lack access to the files evaluation1.tex, evaluation2.tex, and evaluation3.tex:

\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usetikzlibrary{plotmarks}

\begin{document}

\begin{figure}[p] 
\centering

\input{pic/evaluation1}
\caption{Evaluation 1.}
\label{evaluation1}

\vspace{1cm} % choose a suitable amount of vertical whitespace

\input{pic/evaluation2}
\caption{Evaluation 2.}
\label{evaluation2}
\end{figure}

\begin{figure}[t!]
\centering
\input{pic/evaluation3}
\caption{Evaluation 3.}
\label{evaluation3}
\end{figure}

\end{document}
3
  • 1
    Cleaning up unanswered questions? ;-)
    – user31729
    Mar 5, 2017 at 10:21
  • allright, this works fine, when adding an extra \newpage and \null before the last figure. Thanks!
    – user123551
    Mar 5, 2017 at 11:36
  • @Luk - I had assumed that the first figure environment, which contains two graphs, more of less occupies a full page. If that's not the case, then a \newpage (better still: \clearpage) directive may indeed be needed.
    – Mico
    Mar 5, 2017 at 11:57

You must log in to answer this question.