I have a TikZ picture like this:
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xmin=-0.5,xmax=3.5,ymin=-0.5,ymax=3.5
]
\addplot[very thick,blue, samples=300, domain=0:3, name path=A] {sqrt(x)};
\addplot[very thick,yellow!70!red, samples=300, domain=0:3, name path=B] {9-3*x};
\addplot[very thick,red!90!teal, samples=300, domain=0:3, name path=C] {3};
\addplot[very thick,green!70!magenta, samples=300, domain=0:3, name path=D] coordinates{(1/9,-6) (1/9,6)};
\end{axis}
\end{tikzpicture}
I’d like to fill the area enclosed by these four curves.
Similar questions have been answered using pgfplots
’s fillbetween
package, but it only seems to support filling between two curves. What are my options?
Best Answer
Here a workaround, you can divide your area on two parts: first between curve A and C, and the second between A and B and use
soft clip
to limit filling