I'm trying to use the method outline in Graphics: Area between curves to create a graph of the area between two curves to insert into a solution sheet. However, when I do, the box is placed incorrectly. The tikzpicture ends up way higher than it should be, rather than being in line, and so covers up text, or other pictures placed above it. My code is as follows:
\documentclass[11pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns}
\begin{document}
The box for the tikzpicture appears to be much higher than it should be.\\
{\begin{tikzpicture}[scale=0.75]
\begin{axis}[
xmin=0,xmax=5,
ymin=-1, ymax=6,
xtick = {-1,1},
ytick = {1,2,3,4,5,6},
axis lines=center,
axis line style = <->,
ticklabel style = {font=\small}
]
\addplot[name path=F,domain={0:5}] {x};
\addplot[name path=G,domain={0:5}] {(x-2)^2};
\addplot[pattern=north west lines, pattern color=gray!50]fill between[of=F and G, soft clip={domain=1:4}];
\end{axis}
\end{tikzpicture}}
\end{document}

scaleing factor or set it to1everything seems to work fine. – Stefan Pinnow Feb 14 '17 at 21:11