# Fill the intersection of 3 (or more) curves

I couldn't find a simple way to fill the area of the intersections of 3 curves. I want to fill this area:

My try:

\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{my style1/.append style={clip = false, axis lines* = middle, axis equal, xtick = \empty, ytick = \empty}}

\usepgfplotslibrary{fillbetween}

\usepackage{tikz}
\usetikzlibrary{calc, math, positioning, arrows, intersections}

\begin{document}

\begin{tikzpicture}
\begin{axis}[my style1, samples=150]
%\addplot [blue] fill between[of=c1,c2 and c3];

\end{axis}
\end{tikzpicture}

\end{document}



But it seems like fill between only can fill the intersection of 2 curves. Any help would be appreciated.

It seems the soft clip option from pgfplots is not sufficient here, hence I use a \fill following \clip.

Full example

\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{my style1/.append style={clip = false, axis lines* = middle, axis equal, xtick = \empty, ytick = \empty}}

\usepgfplotslibrary{fillbetween}

\usepackage{tikz}
\usetikzlibrary{calc, math, positioning, arrows, intersections}

\begin{document}

\begin{tikzpicture}
\begin{axis}[my style1, samples=150]

% \clip will act on all the following paths in the current scope
\clip (.3,.5) rectangle (1.3,.9);
\fill[blue] (0, 0) plot[domain=0:1.5] (\x, \x^2+.2)
-- plot[domain=1.5:0] (\x, {sqrt(\x)+.2}) -- (0, 0);
\end{axis}
\end{tikzpicture}

\end{document}


• The left corner is supposed to be fill. And you said a thing that is not coherent: pgf v3.1.6 contains a problem but v3.1.6 has fixed this problem – Á. Iborra Oct 2 at 6:51
• @Iborra Looks like soft clip is not sufficient here. And the second v3.1.6 should be v3.1.6a. I will delete this answer. – muzimuzhi Z Oct 2 at 7:42
• @Iborra My answers is updated and a tikz workaround is provided. – muzimuzhi Z Oct 2 at 8:04
• The initial (0,0) and the final -- (0,0) are unnecesary – Á. Iborra Oct 3 at 15:40