I'm using pgfplots and plotting the equations r=1 and r=1-sin(\x/2), but I would like to shade the 3 different regions formed by the curves. I found a link to this bug report asking about using fill between in the polaraxis environment which links to 2 other TeX.SX posts: https://github.com/pgf-tikz/pgfplots/issues/124
This post shades the area containing the origin: Shading between the graphs of two polar equations in pgfplots
This post uses the axis environment instead of the polaraxis environment: Shading a region between two polar curves
Here is the code I'm working with:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{polar, fillbetween}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}[scale=1]
\begin{polaraxis}
[
domain=0:360,
samples=180,
grid=both,
grid style={line width=0.1pt, draw=gray!75},
major grid style={black},
minor x tick num=3,
minor y tick num=3,
xmin=0, xmax=360,
ymin=0, ymax=2.25,
xtick={0,45,...,360},
xticklabels={},
ytick={3},
yticklabel style={anchor=north},
]
\addplot[draw=red, domain=0:720] {1-sin(\x/2)};
\addplot[draw=blue, domain=0:360] {1};
\end{polaraxis}
\end{tikzpicture}
\end{document}


reuse pathmacro, but I think I was trying to use it withscopeand that didn't work. – pwesterbaan Nov 29 '20 at 01:57save pathcreates global macros, yet this business here is a bit tricky and in the best of all worlds one day the issue you mention gets fixed on the pgfplots side. – Nov 29 '20 at 02:00