I was trying to insert a tex file containing the code for a tikz graph into a main tex file. However, I got a problem. The graph always stands alone in an independent page. So any words before or after the inserting command will be a page ahead or a page afterward. The tex file was automatically generated by R package "tikzDevice"
My Latex code is very simple.
\title{homework}
\author{me}
\date{}
\begin{document}
\maketitle
\setmainfont{Microsoft Sans Serif}
\centering
\include{Plot1}
crazy
\include{Plot1}
\end{document}
My tikz tex code for the graph is as below:
\resizebox{\columnwidth}{!}{
\begin{tikzpicture}[x=1pt,y=1pt]
...
\end{tikzpicture}
}

\resizeboxfor elements that contain text, like the graph you show us in your image. See https://tex.stackexchange.com/questions/425453/why-not-scale-elements-that-contain-text for other possibilities instead of\resizebox– samcarter_is_at_topanswers.xyz Dec 16 '18 at 12:59