# Scaling problem with fillbetween in pgfplots

I recently ran into scaling problems with the very nice pgfplots library fillbetween. See the following example, which is perfectly fine:

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}

\begin{document}

\begin{tikzpicture}[scale=1.0]

\begin{semilogxaxis}[xmin=1,xmax=256,grid=both,legend pos=north west,
xlabel=Nb. of sub-domains,ylabel=Number of neighbors,legend cell align=left,
every axis y label/.style={at={(ticklabel cs:0.5)},rotate=90,anchor=near ticklabel},
xtick={1,2,4,8,16,32,64,128,256},xticklabels={1,2,4,8,16,32,64,128,256}]
\legend{Min., Max., Average};

\addplot[color=blue,very thick,mark=*,name path=A] coordinates { (1,0) (2,1) (4,3) (8,4) (16,3) (32,3) (64,4) (128,4) (256,5) }; %Min
\addplot[color=gray,very thick,mark=*,name path=B] coordinates { (1,0) (2,1) (4,3) (8,6) (16,9) (32,12) (64,15) (128,15) (256,16)}; %Max
\addplot[color=black,very thick,mark=*] coordinates { (1,0) (2,1) (4,3) (8,5.5) (16,6.12) (32,7.88) (64,9.59) (128,10.50) (256,11.37)}; %Avg

\end{semilogxaxis}

\end{tikzpicture}

\end{document}


Now, I just change scale=1.0 to scale=0.8, and I obtain the following result:

Note that if I comment the "fillbetween" line in the code, everything works fine when scaling the picture. Does anyone has an idea about this ?

Cheers

Pass the scale=<factor> option to the axis environment and not to the tikzpicture environment:

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}

\begin{document}

\begin{tikzpicture}

\begin{semilogxaxis}[
scale=0.8,
xmin=1,xmax=256,grid=both,legend pos=north west,
xlabel=Nb. of sub-domains,ylabel=Number of neighbors,legend cell align=left,
every axis y label/.style={at={(ticklabel cs:0.5)},rotate=90,anchor=near ticklabel},
xtick={1,2,4,8,16,32,64,128,256},xticklabels={1,2,4,8,16,32,64,128,256}]
\legend{Min., Max., Average};

\addplot[color=blue,very thick,mark=*,name path=A] coordinates { (1,0) (2,1) (4,3) (8,4) (16,3) (32,3) (64,4) (128,4) (256,5) }; %Min
\addplot[color=gray,very thick,mark=*,name path=B] coordinates { (1,0) (2,1) (4,3) (8,6) (16,9) (32,12) (64,15) (128,15) (256,16)}; %Max
\addplot[color=black,very thick,mark=*] coordinates { (1,0) (2,1) (4,3) (8,5.5) (16,6.12) (32,7.88) (64,9.59) (128,10.50) (256,11.37)}; %Avg