# Fill Between with Multiple Tikzpicture

I am using PGFPlots version 1.14 and PGF version 3.0.1a and am having a weird effect with fill between. The coloring for fill between is appearing in the subsequent graph, not in the graph it was defined in.

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween, polar}
\begin{document}

\begin{center}
\begin{tikzpicture}
\begin{polaraxis}[
xtick=\empty,
ytick=\empty,
hide axis,
]
\addplot[domain=0:360, smooth, red, name path = circle]{.5};
\end{polaraxis}
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\end{center}

\end{document}


with result

Why isn't the fill happening in the original picture, and why is the fill showing up in the second picture, even when I put in dummy name paths?

• Apparently the problem is caused by polaraxis. Although the plot would be different, in axis environment everything seems O.K. – Sina Ahmadi Sep 21 '17 at 19:14
• BTW, you could stand to up the number of samples. – John Kormylo Sep 21 '17 at 20:24

Apparently the problem is caused by the polaraxis when filling between the two plots.

Here is my solution for your problem:

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween, polar}
\begin{document}

\begin{center}
\begin{tikzpicture}
\begin{polaraxis}[hide axis]
\begin{scope}[]